Compare commits
67 Commits
foundryvtt
...
foundryvtt
Author | SHA1 | Date | |
---|---|---|---|
9ff68884ce | |||
09986115b8 | |||
511ee5f241 | |||
306d7c2150 | |||
5624bb1bf3 | |||
b588c5f7f8 | |||
6de34178b3 | |||
0c90fba346 | |||
f43b7ac651 | |||
ac436bbb25 | |||
9093eadb23 | |||
5821fc611f | |||
381242c8d0 | |||
3ca33e85b7 | |||
01399e922a | |||
c6afb8d445 | |||
4d68318d85 | |||
7811eae728 | |||
2e74ccd1fe | |||
f98ece4ffd | |||
ed068a8ddd | |||
c938778267 | |||
9056514951 | |||
1047720c24 | |||
43bcf1c336 | |||
14d4638e56 | |||
c761aeceb3 | |||
1759e6d1c3 | |||
ecb47addba | |||
b18f93fbfb | |||
19bfee7ea5 | |||
93e44bb982 | |||
12df910b3a | |||
2a3989ac2e | |||
ab884713f6 | |||
940237852b | |||
78ee23da96 | |||
862a267683 | |||
2373acc295 | |||
249d171511 | |||
018b6a32dd | |||
44ec511aa6 | |||
ff44de3b3c | |||
8101b905d8 | |||
27dd89024e | |||
69a653d1e5 | |||
bea4124388 | |||
e5bb2e9afc | |||
1d3ae9bb1a | |||
d4be2957a3 | |||
6c9d03be92 | |||
5a50917730 | |||
d285e866be | |||
ece9ab6f64 | |||
038e922f0f | |||
728c5f2f8e | |||
e6592f8333 | |||
42567e7ca0 | |||
9d1fe6d8fd | |||
f5bd0f32f4 | |||
fad29f9652 | |||
9d51631d5c | |||
d1b73e7658 | |||
54158ee10d | |||
e089bdf9c8 | |||
41ab593059 | |||
42ad4c5b26 |
71
changelog.md
71
changelog.md
@ -1,4 +1,75 @@
|
||||
# v11.0
|
||||
## v11.1.6 - Les dissections de Werther de Zloth
|
||||
- Fix: on peut de nouveau donner des compétences aux créatures
|
||||
- Fix: le délai de guérison d'une blessure rétrogradée est correctement appliqué
|
||||
- Fix: l'encaissement à valider par le MJ fonctionne de nouveau
|
||||
|
||||
## v11.1.5 - Werther de Zloth l'Onirique
|
||||
- Fixes:
|
||||
- la demande de défense ne marchait plus
|
||||
- la tête réserve extensible crée bien une case de réserve extensible (à modifier)
|
||||
- le souffle trou noir ajoute bien une case de trou noir
|
||||
- la queue urgence draconique ne se transforme plus en idée fixe s'il y a des sorts en réserve
|
||||
- l'ajout d'une nouvelle queue ne supprime plus l'insomnie
|
||||
- Amélioration des jets de vie
|
||||
- un 1 sur le jet de vie est une réussite même si le personnage est dans le coma
|
||||
- le temps avant le prochain jet est calculé et affiché
|
||||
- un 20 sur le jet de vie signifie la mort immédiate
|
||||
- si on dépasse le S.Const, le personnage est bien indiqué comme mort
|
||||
- pas de jets de vie pour les morts
|
||||
|
||||
## v11.1.4 - Werther de Zloth l'Onirique
|
||||
- Ajout du facteur de significative à côté du pourcentage dans le résultat des jets de dés pour rappeler que le pourcentage n'est pas diviasé
|
||||
- Fix: dans les TMRs, les tooltips affichent bien les informations de tous les effets sur la case
|
||||
- Fix: la fatigue et l'éthylisme sont de nouveau pris en compte dans le calcul de l'éthylisme
|
||||
- Fix: Le MJ peut correctement masquer les points de tâche requis
|
||||
- Fix: le jet d'appréciation n'utilise pas la compétence
|
||||
- Fix: la qualité négative n'est pas exotique, elle est juste mauvaise: on n'utilise pas la cuisine pour se retenir de jeter l'assiette
|
||||
- Esthétique: ne pas afficher "+0" pour les ajustements de jets/encaissement
|
||||
|
||||
## v11.1.2 - Les vertèbres de Werther de Zloth
|
||||
- Fix: les jets d'encaissement fonctionnent de nouveau normalement
|
||||
- Macro "Mon personnage" permettant au joueur d'accéder à sa feuille de personnage depuis la barre de macros
|
||||
|
||||
## v11.1.1 - Les fumebols de Werther de Zloth
|
||||
- Fix: on peut de nouveau afficher les vues détaillées
|
||||
- Fix: on peut ouvrir les sacs et contenants portés par les véhicules et créatures
|
||||
- Fix: cuisiner du gibier prend maintenant bien les proportaions en compte
|
||||
|
||||
## v11.1.0 - Les choix de Werther de Zloth
|
||||
- Les options suivantes peuvent être désactivées:
|
||||
- La transformation de stress à Château Dormant
|
||||
- La récuperation de chance à Château Dormant
|
||||
- La récupération d'éthylisme
|
||||
- La récupération de rêve (y compris fleurs de rêve et Rêves de Dragon: la rencontre a lieu, mais ne donne pas de rêve)
|
||||
- Le jet de moral de Château Dormant
|
||||
- Séparation des véhicules dans leur propre acteur
|
||||
- Séparation des entités dans leur propre acteur
|
||||
- Séparation des créatures dans leur propre acteur
|
||||
- La fenêtre de signes draconiques ne sélectionne plus tout les haut-rêvants par défaut
|
||||
- Un nouveau personnage a automatiquement son token relié
|
||||
- corrections de bugs
|
||||
- si on n'utilise pas les règles de fatigues, un reflet de rêve pouvait garder le Haut-rêvant dans les TMRs pour toujours
|
||||
- certaines macros ne marchaient pas pour les créatures/entités/véhicules/commerces
|
||||
- en cas de charge, les particulières sont toujours en force (p125)
|
||||
|
||||
## v11.0.28 - les fractures de Khrachtchoum
|
||||
- La gravité de la blessure est affichée dans le résumé de l'encaissement
|
||||
- Lors du changement d'acteur pendant le round
|
||||
- le message annonçant le joueur dont c'est le tour ne contient plus d'informations de santé
|
||||
- un message avec les informations de santé est envoyé au Gardienn et au propriétaire du token.acteur
|
||||
- le jet de vie est bien fait par le token si besoin
|
||||
- seul les propriétaires peuvent faire les jets de vie
|
||||
- Amélioration de la fenêtre de jets
|
||||
- le type de dégâts pour les attaques est toujours affiché
|
||||
- le moral est indiqué avant l'icone d'appel au moral
|
||||
|
||||
## v11.0.27 - Khrachtchoum le méticuleux
|
||||
- le tooltip dans les TMR reste visible si on ne bouge pas la souris
|
||||
- le surencombrement n'affecte QUE les actions physiques
|
||||
- on peut de nouveau fabriquer une potion depuis la fenêtre d'édition de l'herbe
|
||||
- si les TMR sont minimisées alors qu'une action est requise, elles sont bien réaffichées lorsque l'action est faite
|
||||
|
||||
## v11.0.26 - le crépuscule de Khrachtchoum
|
||||
- gestion correcte des TMRs
|
||||
- les TMRs ne sont jamais minimisées (par le système) quand le haut-rêvant est en demi-rêve
|
||||
|
BIN
icons/voyageurs/personnage.webp
Normal file
BIN
icons/voyageurs/personnage.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.1 KiB |
@ -11,29 +11,25 @@ import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
||||
import { RdDSheetUtility } from "./rdd-sheet-utility.js";
|
||||
import { STATUSES } from "./settings/status-effects.js";
|
||||
import { MAINS_DIRECTRICES } from "./actor.js";
|
||||
import { RdDBaseActorSheet } from "./actor/base-actor-sheet.js";
|
||||
import { RdDBaseActorReveSheet } from "./actor/base-actor-reve-sheet.js";
|
||||
import { RdDItem } from "./item.js";
|
||||
import { RdDItemBlessure } from "./item/blessure.js";
|
||||
import { RdDEmpoignade } from "./rdd-empoignade.js";
|
||||
import { ChatUtility } from "./chat-utility.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/**
|
||||
* Extend the basic ActorSheet with some very simple modifications
|
||||
* @extends {ActorSheet}
|
||||
*/
|
||||
export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
export class RdDActorSheet extends RdDBaseActorReveSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
RdDUtility.initAfficheContenu();
|
||||
return mergeObject(super.defaultOptions, {
|
||||
classes: ["rdd", "sheet", "actor"],
|
||||
return mergeObject(RdDBaseActorReveSheet.defaultOptions, {
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-sheet.html",
|
||||
width: 550,
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }],
|
||||
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: undefined }],
|
||||
showCompNiveauBase: false,
|
||||
vueDetaillee: false,
|
||||
vueArchetype: false,
|
||||
});
|
||||
}
|
||||
@ -56,7 +52,7 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
surprise: RdDBonus.find(this.actor.getSurprise(false)).descr,
|
||||
resumeBlessures: this.actor.computeResumeBlessure(this.actor.system.blessures),
|
||||
caracTotal: RdDCarac.computeTotal(this.actor.system.carac, this.actor.system.beaute),
|
||||
surEncombrementMessage: this.actor.getMessageSurEncombrement(),
|
||||
surEncombrementMessage: this.actor.isSurenc() ? "Sur-Encombrement!" : "",
|
||||
malusArmure: this.actor.getMalusArmure()
|
||||
})
|
||||
|
||||
@ -86,7 +82,7 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
RdDItemArme.computeNiveauArmes(formData.combat, formData.competences);
|
||||
formData.combat.push(RdDItemArme.mainsNues(actor));
|
||||
formData.combat.push(RdDItemArme.empoignade(actor));
|
||||
|
||||
|
||||
formData.esquives = this.actor.getCompetences("Esquive");
|
||||
formData.combat = RdDCombatManager.listActionsArmes(formData.combat, formData.competences, formData.system.carac);
|
||||
formData.empoignades = this.actor.getEmpoignades();
|
||||
@ -115,7 +111,8 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
return formData;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */ /** @override */
|
||||
/* -------------------------------------------- */
|
||||
/** @override */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
@ -124,11 +121,18 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
this.html.find('.item-action').click(async event => {
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
item?.actionPrincipale(this.actor, async () => this.render())
|
||||
});
|
||||
this.html.find('.sheet-possession-attack').click(async event => {
|
||||
const poss = RdDSheetUtility.getItem(event, this.actor)
|
||||
this.actor.conjurerPossession(poss)
|
||||
})
|
||||
|
||||
this.html.find('.subacteur-label a').click(async event => {
|
||||
let actorId = RdDSheetUtility.getEventItemData(event, 'actor-id');
|
||||
let actor = game.actors.get(actorId);
|
||||
if (actor) {
|
||||
actor.sheet.render(true);
|
||||
}
|
||||
});
|
||||
this.html.find('.subacteur-delete').click(async event => {
|
||||
const li = RdDSheetUtility.getEventElement(event);
|
||||
const actorId = li.data("actor-id");
|
||||
@ -158,18 +162,6 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
this.actor.updateCompteurValue("experience", parseInt(event.target.value));
|
||||
});
|
||||
|
||||
this.html.find('.encaisser-direct').click(async event => {
|
||||
this.actor.encaisser();
|
||||
})
|
||||
this.html.find('.sheet-possession-attack').click(async event => {
|
||||
const poss = RdDSheetUtility.getItem(event, this.actor)
|
||||
this.actor.conjurerPossession(poss)
|
||||
})
|
||||
this.html.find('.remise-a-neuf').click(async event => {
|
||||
if (game.user.isGM) {
|
||||
this.actor.remiseANeuf();
|
||||
}
|
||||
});
|
||||
this.html.find('.creer-tache').click(async event => {
|
||||
this.createEmptyTache();
|
||||
});
|
||||
@ -179,9 +171,7 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
this.html.find('.creer-blessure-legere').click(async event => RdDItemBlessure.createBlessure(this.actor, 2));
|
||||
this.html.find('.creer-blessure-grave').click(async event => RdDItemBlessure.createBlessure(this.actor, 4));
|
||||
this.html.find('.creer-blessure-critique').click(async event => RdDItemBlessure.createBlessure(this.actor, 6));
|
||||
this.html.find('.creer-une-oeuvre').click(async event => {
|
||||
this.selectTypeOeuvreToCreate();
|
||||
});
|
||||
this.html.find('.creer-une-oeuvre').click(async event => this.selectTypeOeuvreToCreate());
|
||||
|
||||
this.html.find('.blessure-premierssoins-done').change(async event => {
|
||||
const blessure = this.getBlessure(event);
|
||||
@ -206,11 +196,6 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
});
|
||||
|
||||
// Roll Carac
|
||||
this.html.find('.carac-label a').click(async event => {
|
||||
let caracName = event.currentTarget.attributes.name.value;
|
||||
this.actor.rollCarac(caracName.toLowerCase());
|
||||
});
|
||||
|
||||
this.html.find('.chance-actuelle').click(async event => {
|
||||
this.actor.rollCarac('chance-actuelle');
|
||||
});
|
||||
@ -219,14 +204,10 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
this.actor.rollAppelChance();
|
||||
});
|
||||
|
||||
// Roll Skill
|
||||
this.html.find('[name="jet-astrologie"]').click(async event => {
|
||||
this.actor.astrologieNombresAstraux();
|
||||
});
|
||||
|
||||
// Roll Skill
|
||||
this.html.find('a.competence-label').click(async event => {
|
||||
this.actor.rollCompetence(RdDSheetUtility.getItemId(event));
|
||||
});
|
||||
this.html.find('.tache-label a').click(async event => {
|
||||
this.actor.rollTache(RdDSheetUtility.getItemId(event));
|
||||
});
|
||||
@ -251,13 +232,6 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
this.html.find('.recettecuisine-label a').click(async event => {
|
||||
this.actor.rollRecetteCuisine(RdDSheetUtility.getItemId(event));
|
||||
});
|
||||
this.html.find('.subacteur-label a').click(async event => {
|
||||
let actorId = RdDSheetUtility.getEventItemData(event, 'actor-id');
|
||||
let actor = game.actors.get(actorId);
|
||||
if (actor) {
|
||||
actor.sheet.render(true);
|
||||
}
|
||||
});
|
||||
|
||||
// Boutons spéciaux MJs
|
||||
this.html.find('.forcer-tmr-aleatoire').click(async event => {
|
||||
@ -292,35 +266,12 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
ui.notifications.info("Impossible de lancer l'initiative sans être dans un combat.");
|
||||
}
|
||||
});
|
||||
// Display TMR, visualisation
|
||||
this.html.find('.visu-tmr').click(async event => {
|
||||
this.actor.displayTMR("visu");
|
||||
});
|
||||
// Display TMR
|
||||
this.html.find('.visu-tmr').click(async event => { this.actor.displayTMR("visu") })
|
||||
this.html.find('.monte-tmr').click(async event => { this.actor.displayTMR("normal") })
|
||||
this.html.find('.monte-tmr-rapide').click(async event => { this.actor.displayTMR("rapide") })
|
||||
|
||||
// Display TMR, normal
|
||||
this.html.find('.monte-tmr').click(async event => {
|
||||
this.actor.displayTMR("normal");
|
||||
});
|
||||
|
||||
// Display TMR, fast
|
||||
this.html.find('.monte-tmr-rapide').click(async event => {
|
||||
this.actor.displayTMR("rapide");
|
||||
});
|
||||
|
||||
this.html.find('.repos').click(async event => {
|
||||
await this.actor.repos();
|
||||
});
|
||||
this.html.find('.delete-active-effect').click(async event => {
|
||||
if (game.user.isGM) {
|
||||
let effect = this.html.find(event.currentTarget).parents(".active-effect").data('effect');
|
||||
this.actor.removeEffect(effect);
|
||||
}
|
||||
});
|
||||
this.html.find('.enlever-tous-effets').click(async event => {
|
||||
if (game.user.isGM) {
|
||||
await this.actor.removeEffects();
|
||||
}
|
||||
});
|
||||
this.html.find('.repos').click(async event => { await this.actor.repos() })
|
||||
this.html.find('.carac-xp-augmenter').click(async event => {
|
||||
let caracName = event.currentTarget.name.replace("augmenter.", "");
|
||||
this.actor.updateCaracXPAuto(caracName);
|
||||
@ -334,30 +285,20 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
|
||||
if (this.options.vueDetaillee) {
|
||||
// On carac change
|
||||
this.html.find('.carac-value').change(async event => {
|
||||
let caracName = event.currentTarget.name.replace(".value", "").replace("system.carac.", "");
|
||||
this.actor.updateCarac(caracName, parseInt(event.target.value));
|
||||
});
|
||||
this.html.find('input.carac-xp').change(async event => {
|
||||
let caracName = event.currentTarget.name.replace(".xp", "").replace("system.carac.", "");
|
||||
this.actor.updateCaracXP(caracName, parseInt(event.target.value));
|
||||
});
|
||||
// On competence change
|
||||
this.html.find('.competence-value').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
//console.log("Competence changed :", compName);
|
||||
this.actor.updateCompetence(compName, parseInt(event.target.value));
|
||||
});
|
||||
// On competence xp change
|
||||
this.html.find('input.competence-xp').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
this.actor.updateCompetenceXP(compName, parseInt(event.target.value));
|
||||
});
|
||||
// On competence xp change
|
||||
this.html.find('input.competence-xp-sort').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
this.actor.updateCompetenceXPSort(compName, parseInt(event.target.value));
|
||||
});
|
||||
|
||||
this.html.find('.toggle-archetype').click(async event => {
|
||||
this.options.vueArchetype = !this.options.vueArchetype;
|
||||
this.render(true);
|
||||
@ -377,11 +318,6 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
this.render(true);
|
||||
});
|
||||
|
||||
this.html.find('.vue-detaillee').click(async event => {
|
||||
this.options.vueDetaillee = !this.options.vueDetaillee;
|
||||
this.render(true);
|
||||
});
|
||||
|
||||
// On pts de reve change
|
||||
this.html.find('.pointsreve-value').change(async event => {
|
||||
let reveValue = event.currentTarget.value;
|
||||
@ -394,11 +330,6 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
this.actor.setPointsDeSeuil(event.currentTarget.value);
|
||||
});
|
||||
|
||||
// On stress change
|
||||
this.html.find('.compteur-edit').change(async event => {
|
||||
let fieldName = event.currentTarget.attributes.name.value;
|
||||
this.actor.updateCompteurValue(fieldName, parseInt(event.target.value));
|
||||
});
|
||||
|
||||
this.html.find('.stress-test').click(async event => {
|
||||
this.actor.transformerStress();
|
||||
@ -417,10 +348,10 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
});
|
||||
|
||||
this.html.find('.jet-vie').click(async event => {
|
||||
this.actor.jetVie();
|
||||
this.actor.jetDeVie();
|
||||
});
|
||||
this.html.find('.jet-endurance').click(async event => {
|
||||
this.actor.jetEndurance();
|
||||
await this.jetEndurance();
|
||||
});
|
||||
|
||||
this.html.find('.vie-plus').click(async event => {
|
||||
@ -429,12 +360,6 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
this.html.find('.vie-moins').click(async event => {
|
||||
this.actor.santeIncDec("vie", -1);
|
||||
});
|
||||
this.html.find('.endurance-plus').click(async event => {
|
||||
this.actor.santeIncDec("endurance", 1);
|
||||
});
|
||||
this.html.find('.endurance-moins').click(async event => {
|
||||
this.actor.santeIncDec("endurance", -1);
|
||||
});
|
||||
this.html.find('.ptreve-actuel-plus').click(async event => {
|
||||
this.actor.reveActuelIncDec(1);
|
||||
});
|
||||
@ -449,6 +374,16 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
});
|
||||
}
|
||||
|
||||
async jetEndurance() {
|
||||
const endurance = this.actor.getEnduranceActuelle()
|
||||
const result = await this.actor.jetEndurance(endurance);
|
||||
ChatMessage.create({
|
||||
content: `Jet d'Endurance : ${result.jetEndurance} / ${endurance}
|
||||
<br>${this.actor.name} a ${result.sonne ? 'échoué' : 'réussi'} son Jet d'Endurance ${result.sonne ? 'et devient Sonné' : ''}`,
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.actor.name)
|
||||
});
|
||||
}
|
||||
|
||||
getBlessure(event) {
|
||||
const itemId = this.html.find(event.currentTarget).parents(".item-blessure").data('item-id');
|
||||
const blessure = this.actor.getItem(itemId, 'blessure');
|
||||
|
1185
module/actor.js
1185
module/actor.js
File diff suppressed because it is too large
Load Diff
64
module/actor/base-actor-reve-sheet.js
Normal file
64
module/actor/base-actor-reve-sheet.js
Normal file
@ -0,0 +1,64 @@
|
||||
import { RdDSheetUtility } from "../rdd-sheet-utility.js";
|
||||
import { RdDBaseActorSheet } from "./base-actor-sheet.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/**
|
||||
* Extend the basic ActorSheet with some very simple modifications
|
||||
* @extends {ActorSheet}
|
||||
*/
|
||||
export class RdDBaseActorReveSheet extends RdDBaseActorSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return mergeObject(RdDBaseActorSheet.defaultOptions, {
|
||||
width: 550
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/** @override */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
this.html.find('.encaisser-direct').click(async event => {
|
||||
this.actor.encaisser();
|
||||
})
|
||||
this.html.find('.remise-a-neuf').click(async event => {
|
||||
if (game.user.isGM) {
|
||||
this.actor.remiseANeuf();
|
||||
}
|
||||
});
|
||||
|
||||
this.html.find('.carac-label a').click(async event => {
|
||||
let caracName = event.currentTarget.attributes.name.value;
|
||||
this.actor.rollCarac(caracName.toLowerCase());
|
||||
});
|
||||
|
||||
this.html.find('a.competence-label').click(async event => {
|
||||
this.actor.rollCompetence(RdDSheetUtility.getItemId(event));
|
||||
});
|
||||
|
||||
this.html.find('.delete-active-effect').click(async event => {
|
||||
if (game.user.isGM) {
|
||||
let effect = this.html.find(event.currentTarget).parents(".active-effect").data('effect');
|
||||
this.actor.removeEffect(effect);
|
||||
}
|
||||
});
|
||||
this.html.find('.enlever-tous-effets').click(async event => {
|
||||
if (game.user.isGM) {
|
||||
await this.actor.removeEffects();
|
||||
}
|
||||
});
|
||||
|
||||
this.html.find('.endurance-plus').click(async event => {
|
||||
this.actor.santeIncDec("endurance", 1);
|
||||
});
|
||||
this.html.find('.endurance-moins').click(async event => {
|
||||
this.actor.santeIncDec("endurance", -1);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
509
module/actor/base-actor-reve.js
Normal file
509
module/actor/base-actor-reve.js
Normal file
@ -0,0 +1,509 @@
|
||||
import { ChatUtility } from "../chat-utility.js";
|
||||
import { DialogValidationEncaissement } from "../dialog-validation-encaissement.js";
|
||||
import { Grammar } from "../grammar.js";
|
||||
import { RdDItemCompetence } from "../item-competence.js";
|
||||
import { Misc } from "../misc.js";
|
||||
import { RdDEmpoignade } from "../rdd-empoignade.js";
|
||||
import { RdDResolutionTable } from "../rdd-resolution-table.js";
|
||||
import { RdDEncaisser } from "../rdd-roll-encaisser.js";
|
||||
import { RdDRoll } from "../rdd-roll.js";
|
||||
import { RdDUtility } from "../rdd-utility.js";
|
||||
import { ReglesOptionnelles } from "../settings/regles-optionnelles.js";
|
||||
import { RdDBaseActor } from "./base-actor.js";
|
||||
import { RdDItemCompetenceCreature } from "../item-competencecreature.js";
|
||||
import { StatusEffects } from "../settings/status-effects.js";
|
||||
import { TYPES } from "../item.js";
|
||||
import { Targets } from "../targets.js";
|
||||
import { RdDPossession } from "../rdd-possession.js";
|
||||
import { RdDCombat } from "../rdd-combat.js";
|
||||
import { RdDConfirm } from "../rdd-confirm.js";
|
||||
import { ENTITE_INCARNE, SHOW_DICE, SYSTEM_RDD } from "../constants.js";
|
||||
import { RdDItemArme } from "../item-arme.js";
|
||||
|
||||
const POSSESSION_SANS_DRACONIC = {
|
||||
img: 'systems/foundryvtt-reve-de-dragon/icons/entites/possession.webp',
|
||||
name: 'Sans draconic',
|
||||
system: {
|
||||
niveau: 0,
|
||||
defaut_carac: "reve-actuel",
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Classe de base pour les acteurs disposant de rêve (donc, pas des objets)
|
||||
* - Entités de rêve
|
||||
* - Créatures de "sang": créatures et humanoides
|
||||
*/
|
||||
export class RdDBaseActorReve extends RdDBaseActor {
|
||||
|
||||
getCaracChanceActuelle() {
|
||||
return {
|
||||
label: 'Chance actuelle',
|
||||
value: this.getChanceActuel(),
|
||||
type: "number"
|
||||
};
|
||||
}
|
||||
|
||||
getCaracReveActuel() {
|
||||
return {
|
||||
label: 'Rêve actuel',
|
||||
value: this.getReveActuel(),
|
||||
type: "number"
|
||||
};
|
||||
}
|
||||
|
||||
getReveActuel() { return this.getReve() }
|
||||
getChanceActuel() { return this.getChance() }
|
||||
|
||||
getReve() { return Number(this.system.carac.reve?.value ?? 0) }
|
||||
getForce() { return this.getReve() }
|
||||
getTaille() { return Number(this.system.carac.taille?.value ?? 0) }
|
||||
getAgilite() { return this.getForce() }
|
||||
getChance() { return this.getReve() }
|
||||
getMoralTotal() { return 0 }
|
||||
getBonusDegat() { return Number(this.system.attributs?.plusdom?.value ?? 0) }
|
||||
getProtectionNaturelle() { return Number(this.system.attributs?.protection?.value ?? 0) }
|
||||
getSConst() { return 0 }
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getEncombrementMax() { return 0 }
|
||||
isSurenc() { return false }
|
||||
computeMalusSurEncombrement() { return 0 }
|
||||
|
||||
ajustementAstrologique() { return 0 }
|
||||
getMalusArmure() { return 0 }
|
||||
|
||||
getEnduranceActuelle() {
|
||||
return Number(this.system.sante?.endurance?.value ?? 0);
|
||||
}
|
||||
async jetEndurance(resteEndurance = undefined) { return { jetEndurance: 0, sonne: false } }
|
||||
isDead() { return false }
|
||||
blessuresASoigner() { return [] }
|
||||
getEtatGeneral(options = { ethylisme: false }) { return 0 }
|
||||
|
||||
async computeArmure(attackerRoll) { return this.getProtectionNaturelle() }
|
||||
async remiseANeuf() { }
|
||||
async appliquerAjoutExperience(rollData, hideChatMessage = 'show') { }
|
||||
|
||||
async santeIncDec(name, inc, isCritique = false) { }
|
||||
|
||||
async finDeRound(options = { terminer: false }) {
|
||||
await this.$finDeRoundSuppressionEffetsTermines(options);
|
||||
await this.finDeRoundBlessures();
|
||||
await this.$finDeRoundSupprimerObsoletes();
|
||||
await this.$finDeRoundEmpoignade();
|
||||
}
|
||||
|
||||
async $finDeRoundSuppressionEffetsTermines(options) {
|
||||
for (let effect of this.getEffects()) {
|
||||
if (effect.duration.type !== 'none' && (effect.duration.remaining <= 0 || options.terminer)) {
|
||||
await effect.delete();
|
||||
ChatMessage.create({ content: `${this.name} n'est plus ${Misc.lowerFirst(game.i18n.localize(effect.system.label))} !` });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async finDeRoundBlessures() {
|
||||
}
|
||||
|
||||
async $finDeRoundSupprimerObsoletes() {
|
||||
const obsoletes = []
|
||||
.concat(this.itemTypes[TYPES.empoignade].filter(it => it.system.pointsemp <= 0))
|
||||
.concat(this.itemTypes[TYPES.possession].filter(it => it.system.compteur < -2 || it.system.compteur > 2))
|
||||
.map(it => it.id);
|
||||
await this.deleteEmbeddedDocuments('Item', obsoletes);
|
||||
}
|
||||
|
||||
async $finDeRoundEmpoignade() {
|
||||
const immobilisations = this.itemTypes[TYPES.empoignade].filter(it => it.system.pointsemp >= 2 && it.system.empoigneurid == this.id);
|
||||
immobilisations.forEach(emp => RdDEmpoignade.onImmobilisation(this,
|
||||
game.actors.get(emp.system.empoigneid),
|
||||
emp
|
||||
))
|
||||
}
|
||||
|
||||
async setSonne(sonne = true) { }
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getCompetence(idOrName, options = {}) {
|
||||
if (idOrName instanceof Item) {
|
||||
return idOrName.isCompetence() ? idOrName : undefined
|
||||
}
|
||||
return RdDItemCompetence.findCompetence(this.items, idOrName, options)
|
||||
}
|
||||
getCompetences(name) {
|
||||
return RdDItemCompetence.findCompetences(this.items, name)
|
||||
}
|
||||
getCompetenceCorpsACorps(options = {}) {
|
||||
return this.getCompetence("Corps à corps", options)
|
||||
}
|
||||
getCompetencesEsquive() {
|
||||
return this.getCompetences("esquive")
|
||||
}
|
||||
|
||||
getArmeParade(armeParadeId) {
|
||||
const item = armeParadeId ? this.getEmbeddedDocument('Item', armeParadeId) : undefined;
|
||||
return RdDItemArme.getArme(item);
|
||||
}
|
||||
|
||||
getDraconicOuPossession() {
|
||||
return POSSESSION_SANS_DRACONIC
|
||||
}
|
||||
|
||||
getPossession(possessionId) {
|
||||
return this.itemTypes[TYPES.possession].find(it => it.system.possessionid == possessionId);
|
||||
}
|
||||
getPossessions() {
|
||||
return this.itemTypes[TYPES.possession];
|
||||
}
|
||||
getEmpoignades() {
|
||||
return this.itemTypes[TYPES.empoignade];
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async updateCreatureCompetence(idOrName, fieldName, value) {
|
||||
let competence = this.getCompetence(idOrName);
|
||||
if (competence) {
|
||||
function getFieldPath(fieldName) {
|
||||
switch (fieldName) {
|
||||
case "niveau": return 'system.niveau';
|
||||
case "dommages": return 'system.dommages';
|
||||
case "carac_value": return 'system.carac_value';
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
const path = getFieldPath(fieldName);
|
||||
if (path) {
|
||||
await this.updateEmbeddedDocuments('Item', [{ _id: competence.id, [path]: value }]); // updates one EmbeddedEntity
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
isEffectAllowed(statusId) { return true }
|
||||
|
||||
getEffects(filter = e => true) {
|
||||
return this.getEmbeddedCollection("ActiveEffect").filter(filter);
|
||||
}
|
||||
|
||||
getEffect(statusId) {
|
||||
return this.getEmbeddedCollection("ActiveEffect").find(it => it.flags?.core?.statusId == statusId);
|
||||
}
|
||||
|
||||
async setEffect(statusId, status) {
|
||||
if (this.isEffectAllowed(statusId)) {
|
||||
const effect = this.getEffect(statusId);
|
||||
if (!status && effect) {
|
||||
await this.deleteEmbeddedDocuments('ActiveEffect', [effect.id]);
|
||||
}
|
||||
if (status && !effect) {
|
||||
await this.createEmbeddedDocuments("ActiveEffect", [StatusEffects.status(statusId)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async removeEffect(statusId) {
|
||||
const effect = this.getEffect(statusId);
|
||||
if (effect) {
|
||||
await this.deleteEmbeddedDocuments('ActiveEffect', [effect.id]);
|
||||
}
|
||||
}
|
||||
|
||||
async removeEffects(filter = e => true) {
|
||||
if (game.user.isGM) {
|
||||
const ids = this.getEffects(filter).map(it => it.id);
|
||||
await this.deleteEmbeddedDocuments('ActiveEffect', ids);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getSurprise(isCombat = undefined) {
|
||||
let niveauSurprise = this.getEffects()
|
||||
.map(effect => StatusEffects.valeurSurprise(effect, isCombat))
|
||||
.reduce(Misc.sum(), 0);
|
||||
if (niveauSurprise > 1) {
|
||||
return 'totale';
|
||||
}
|
||||
if (niveauSurprise == 1) {
|
||||
return 'demi';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async computeEtatGeneral() {
|
||||
// Par défaut, on ne calcule pas d'état général, seuls les personnages/créatures sont affectés
|
||||
this.system.compteurs.etat.value = 0;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async openRollDialog({ name, label, template, rollData, callbackAction }) {
|
||||
const dialog = await RdDRoll.create(this, rollData,
|
||||
{ html: template, close: async html => await this._onCloseRollDialog(html) },
|
||||
{
|
||||
name: name,
|
||||
label: label,
|
||||
callbacks: [
|
||||
this.createCallbackExperience(),
|
||||
this.createCallbackAppelAuMoral(),
|
||||
{ action: callbackAction }
|
||||
]
|
||||
});
|
||||
dialog.render(true);
|
||||
return dialog
|
||||
}
|
||||
|
||||
createEmptyCallback() {
|
||||
return {
|
||||
condition: r => false,
|
||||
action: r => { }
|
||||
};
|
||||
}
|
||||
createCallbackExperience() { return this.createEmptyCallback(); }
|
||||
createCallbackAppelAuMoral() { return this.createEmptyCallback(); }
|
||||
async _onCloseRollDialog(html) { }
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async roll() {
|
||||
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
||||
|
||||
const carac = this.getCarac()
|
||||
const selectedCaracName = ['apparence', 'perception', 'force', 'reve'].find(it => carac[it] != undefined)
|
||||
|
||||
await this.openRollDialog({
|
||||
name: `jet-${this.id}`,
|
||||
label: `Jet de ${this.name}`,
|
||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll.html',
|
||||
rollData: {
|
||||
carac: carac,
|
||||
selectedCarac: carac[selectedCaracName],
|
||||
selectedCaracName: selectedCaracName,
|
||||
competences: this.itemTypes['competence']
|
||||
},
|
||||
callbackAction: r => this.$onRollCaracResult(r)
|
||||
});
|
||||
}
|
||||
|
||||
getCarac() {
|
||||
// TODO: le niveau d'une entité de cauchemar devrait être exclu...
|
||||
const carac = mergeObject(duplicate(this.system.carac),
|
||||
{
|
||||
'reve-actuel': this.getCaracReveActuel(),
|
||||
'chance-actuelle': this.getCaracChanceActuelle()
|
||||
});
|
||||
return carac;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollCarac(caracName, jetResistance = undefined) {
|
||||
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
||||
let selectedCarac = this.getCaracByName(caracName)
|
||||
await this.openRollDialog({
|
||||
name: 'jet-' + caracName,
|
||||
label: 'Jet ' + Grammar.apostrophe('de', selectedCarac.label),
|
||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html',
|
||||
rollData: {
|
||||
selectedCarac: selectedCarac,
|
||||
competences: this.itemTypes['competence'],
|
||||
jetResistance: jetResistance ? caracName : undefined
|
||||
},
|
||||
callbackAction: r => this.$onRollCaracResult(r)
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async $onRollCaracResult(rollData) {
|
||||
// Final chat message
|
||||
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-general.html');
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollCompetence(idOrName, options = { tryTarget: true }) {
|
||||
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
||||
const competence = this.getCompetence(idOrName);
|
||||
let rollData = { carac: this.system.carac, competence: competence }
|
||||
if (competence.type == TYPES.competencecreature) {
|
||||
const arme = RdDItemCompetenceCreature.armeCreature(competence)
|
||||
if (arme && options.tryTarget && Targets.hasTargets()) {
|
||||
Targets.selectOneToken(target => {
|
||||
if (arme.action == "possession") {
|
||||
RdDPossession.onAttaquePossession(target, this, competence)
|
||||
}
|
||||
else {
|
||||
RdDCombat.rddCombatTarget(target, this).attaque(competence, arme)
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
// Transformer la competence de créature
|
||||
RdDItemCompetenceCreature.setRollDataCreature(rollData)
|
||||
}
|
||||
|
||||
await this.openRollDialog({
|
||||
name: 'jet-competence',
|
||||
label: 'Jet ' + Grammar.apostrophe('de', competence.name),
|
||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html',
|
||||
rollData: rollData,
|
||||
callbackAction: r => this.$onRollCompetence(r, options)
|
||||
});
|
||||
}
|
||||
|
||||
async $onRollCompetence(rollData, options) {
|
||||
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-competence.html')
|
||||
if (options?.onRollAutomate) {
|
||||
options.onRollAutomate(rollData);
|
||||
}
|
||||
}
|
||||
|
||||
/** --------------------------------------------
|
||||
* @param {*} arme item d'arme/compétence de créature
|
||||
* @param {*} categorieArme catégorie d'attaque à utiliser: competence (== melee), lancer, tir; naturelle, possession
|
||||
* @returns
|
||||
*/
|
||||
rollArme(arme, categorieArme = "competence") {
|
||||
let compToUse = this.$getCompetenceArme(arme, categorieArme)
|
||||
if (!Targets.hasTargets()) {
|
||||
RdDConfirm.confirmer({
|
||||
settingConfirmer: "confirmer-combat-sans-cible",
|
||||
content: `<p>Voulez vous faire un jet de ${compToUse} sans choisir de cible valide?
|
||||
<br>Tous les jets de combats devront être gérés à la main
|
||||
</p>`,
|
||||
title: 'Ne pas utiliser les automatisation de combat',
|
||||
buttonLabel: "Pas d'automatisation",
|
||||
onAction: async () => {
|
||||
this.rollCompetence(compToUse, { tryTarget: false })
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Targets.selectOneToken(target => {
|
||||
if (Targets.isTargetEntite(target)) {
|
||||
ui.notifications.warn(`Vous ne pouvez pas attaquer une entité non incarnée avec votre ${arme.name}!!!!`);
|
||||
return;
|
||||
}
|
||||
|
||||
const competence = this.getCompetence(compToUse)
|
||||
//console.log("RollArme", competence, arme)
|
||||
if (competence.isCompetencePossession()) {
|
||||
return RdDPossession.onAttaquePossession(target, this, competence);
|
||||
}
|
||||
RdDCombat.rddCombatTarget(target, this).attaque(competence, arme);
|
||||
})
|
||||
}
|
||||
|
||||
$getCompetenceArme(arme, competenceName) {
|
||||
switch (arme.type) {
|
||||
case TYPES.competencecreature:
|
||||
return arme.name
|
||||
case TYPES.arme:
|
||||
switch (competenceName) {
|
||||
case 'competence': return arme.system.competence;
|
||||
case 'unemain': return RdDItemArme.competence1Mains(arme);
|
||||
case 'deuxmains': return RdDItemArme.competence2Mains(arme);
|
||||
case 'tir': return arme.system.tir;
|
||||
case 'lancer': return arme.system.lancer;
|
||||
}
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
verifierForceMin(item) {
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async resetItemUse() { }
|
||||
async incDecItemUse(itemId, inc = 1) { }
|
||||
getItemUse(itemId) { return 0; }
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async encaisser() { await RdDEncaisser.encaisser(this) }
|
||||
|
||||
async encaisserDommages(rollData, attacker = undefined, show = undefined) {
|
||||
if (attacker && !await attacker.accorder(this, 'avant-encaissement')) {
|
||||
return;
|
||||
}
|
||||
const attackerId = attacker?.id;
|
||||
if (ReglesOptionnelles.isUsing('validation-encaissement-gr') && !game.user.isGM) {
|
||||
RdDBaseActor.remoteActorCall({
|
||||
tokenId: this.token?.id,
|
||||
actorId: this.id,
|
||||
method: 'encaisserDommages',
|
||||
args: [rollData, show, attackerId]
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const armure = await this.computeArmure(rollData);
|
||||
if (ReglesOptionnelles.isUsing('validation-encaissement-gr')) {
|
||||
DialogValidationEncaissement.validerEncaissement(this, rollData, armure,
|
||||
jet => this.$onEncaissement(jet, show, attacker));
|
||||
}
|
||||
else {
|
||||
const jet = await RdDUtility.jetEncaissement(rollData, armure, { showDice: SHOW_DICE });
|
||||
await this.$onEncaissement(jet, show, attacker);
|
||||
}
|
||||
}
|
||||
|
||||
async $onEncaissement(jet, show, attacker) {
|
||||
await this.onAppliquerJetEncaissement(jet, attacker);
|
||||
await this.$afficherEncaissement(jet, show);
|
||||
}
|
||||
|
||||
async onAppliquerJetEncaissement(encaissement, attacker) { }
|
||||
|
||||
async $afficherEncaissement(encaissement, show) {
|
||||
mergeObject(encaissement, {
|
||||
alias: this.name,
|
||||
hasPlayerOwner: this.hasPlayerOwner,
|
||||
show: show ?? {}
|
||||
});
|
||||
|
||||
await ChatUtility.createChatWithRollMode(this.name, {
|
||||
roll: encaissement.roll,
|
||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-resultat-encaissement.html', encaissement)
|
||||
});
|
||||
|
||||
if (!encaissement.hasPlayerOwner && encaissement.endurance != 0) {
|
||||
encaissement = duplicate(encaissement);
|
||||
encaissement.isGM = true;
|
||||
ChatMessage.create({
|
||||
whisper: ChatMessage.getWhisperRecipients("GM"),
|
||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-resultat-encaissement.html', encaissement)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async accorder(entite, when = 'avant-encaissement') {
|
||||
if (when != game.settings.get(SYSTEM_RDD, "accorder-entite-cauchemar")
|
||||
|| entite == undefined
|
||||
|| !entite.isEntite([ENTITE_INCARNE])
|
||||
|| entite.isEntiteAccordee(this)) {
|
||||
return true;
|
||||
}
|
||||
const rolled = await RdDResolutionTable.roll(this.getReveActuel(), - Number(entite.system.carac.niveau.value));
|
||||
const rollData = {
|
||||
alias: this.name,
|
||||
rolled: rolled,
|
||||
entite: entite.name,
|
||||
selectedCarac: this.system.carac.reve
|
||||
};
|
||||
|
||||
if (rolled.isSuccess) {
|
||||
await entite.setEntiteReveAccordee(this);
|
||||
}
|
||||
|
||||
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-accorder-cauchemar.html');
|
||||
if (rolled.isPart) {
|
||||
await this.appliquerAjoutExperience(rollData, true);
|
||||
}
|
||||
return rolled.isSuccess;
|
||||
}
|
||||
|
||||
isEntiteAccordee(attacker) { return true }
|
||||
|
||||
async setEntiteReveAccordee(attacker) {
|
||||
ui.notifications.error("Impossible de s'accorder à " + this.name + ": ce n'est pas une entite de cauchemer/rêve");
|
||||
}
|
||||
|
||||
}
|
291
module/actor/base-actor-sang.js
Normal file
291
module/actor/base-actor-sang.js
Normal file
@ -0,0 +1,291 @@
|
||||
import { MAX_ENDURANCE_FATIGUE, RdDUtility } from "../rdd-utility.js";
|
||||
import { ReglesOptionnelles } from "../settings/regles-optionnelles.js";
|
||||
import { STATUSES } from "../settings/status-effects.js";
|
||||
import { TYPES } from "../item.js";
|
||||
import { RdDBaseActorReve } from "./base-actor-reve.js";
|
||||
import { RdDDice } from "../rdd-dice.js";
|
||||
import { RdDItemBlessure } from "../item/blessure.js";
|
||||
|
||||
/**
|
||||
* Classe de base pour les acteurs qui peuvent subir des blessures
|
||||
* - créatures
|
||||
* - humanoides
|
||||
*/
|
||||
export class RdDBaseActorSang extends RdDBaseActorReve {
|
||||
|
||||
|
||||
getForce() { return Number(this.system.carac.force?.value ?? 0) }
|
||||
|
||||
getBonusDegat() { return Number(this.system.attributs?.plusdom?.value ?? 0) }
|
||||
getProtectionNaturelle() { return Number(this.system.attributs?.protection?.value ?? 0) }
|
||||
getSConst() { return 0 }
|
||||
|
||||
getEnduranceMax() {
|
||||
return Math.max(1, Math.min(this.system.sante.endurance.max, MAX_ENDURANCE_FATIGUE));
|
||||
}
|
||||
|
||||
getFatigueActuelle() {
|
||||
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
||||
return Math.max(0, Math.min(this.getFatigueMax(), this.system.sante.fatigue?.value));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
getFatigueRestante() {
|
||||
return this.getFatigueMax() - this.getFatigueActuelle();
|
||||
}
|
||||
|
||||
getFatigueMin() {
|
||||
return this.system.sante.endurance.max - this.system.sante.endurance.value;
|
||||
}
|
||||
|
||||
getFatigueMax() { return this.getEnduranceMax() * 2 }
|
||||
|
||||
malusFatigue() {
|
||||
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
||||
return RdDUtility.calculMalusFatigue(this.getFatigueActuelle(), this.getEnduranceMax())
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getEncombrementMax() { return Number(this.system.attributs?.encombrement?.value ?? 0) }
|
||||
isSurenc() { return this.computeMalusSurEncombrement() < 0 }
|
||||
|
||||
computeMalusSurEncombrement() {
|
||||
return Math.min(0, Math.floor(this.getEncombrementMax() - this.encTotal));
|
||||
}
|
||||
|
||||
isDead() {
|
||||
return this.system.sante.vie.value < -this.getSConst()
|
||||
}
|
||||
|
||||
nbBlessuresLegeres() {
|
||||
return this.itemTypes[TYPES.blessure].filter(it => it.isLegere()).length;
|
||||
}
|
||||
nbBlessuresGraves() {
|
||||
return this.itemTypes[TYPES.blessure].filter(it => it.isGrave()).length;
|
||||
}
|
||||
nbBlessuresCritiques() {
|
||||
return this.itemTypes[TYPES.blessure].filter(it => it.isCritique()).length;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
computeResumeBlessure() {
|
||||
const nbLegeres = this.nbBlessuresLegeres()
|
||||
const nbGraves = this.nbBlessuresGraves()
|
||||
const nbCritiques = this.nbBlessuresCritiques()
|
||||
|
||||
if (nbLegeres + nbGraves + nbCritiques == 0) {
|
||||
return "Aucune blessure";
|
||||
}
|
||||
let resume = "Blessures:";
|
||||
if (nbLegeres > 0) {
|
||||
resume += " " + nbLegeres + " légère" + (nbLegeres > 1 ? "s" : "");
|
||||
}
|
||||
if (nbGraves > 0) {
|
||||
if (nbLegeres > 0)
|
||||
resume += ",";
|
||||
resume += " " + nbGraves + " grave" + (nbGraves > 1 ? "s" : "");
|
||||
}
|
||||
if (nbCritiques > 0) {
|
||||
if (nbGraves > 0 || nbLegeres > 0)
|
||||
resume += ",";
|
||||
resume += " une CRITIQUE !";
|
||||
}
|
||||
return resume;
|
||||
}
|
||||
|
||||
blessuresASoigner() { return [] }
|
||||
getEtatGeneral(options = { ethylisme: false }) { return 0 }
|
||||
|
||||
async computeArmure(attackerRoll) { return this.getProtectionNaturelle() }
|
||||
async remiseANeuf() { }
|
||||
async appliquerAjoutExperience(rollData, hideChatMessage = 'show') { }
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
async onAppliquerJetEncaissement(encaissement, attacker) {
|
||||
const santeOrig = duplicate(this.system.sante);
|
||||
const blessure = await this.ajouterBlessure(encaissement, attacker); // Will update the result table
|
||||
const perteVie = await this.santeIncDec("vie", -encaissement.vie);
|
||||
const perteEndurance = await this.santeIncDec("endurance", -encaissement.endurance, blessure?.isCritique());
|
||||
|
||||
mergeObject(encaissement, {
|
||||
resteEndurance: perteEndurance.newValue,
|
||||
sonne: perteEndurance.sonne,
|
||||
jetEndurance: perteEndurance.jetEndurance,
|
||||
endurance: perteEndurance.perte,
|
||||
vie: santeOrig.vie.value - perteVie.newValue,
|
||||
blessure: blessure
|
||||
});
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async santeIncDec(name, inc, isCritique = false) {
|
||||
if (name == 'fatigue' && !ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
||||
return;
|
||||
}
|
||||
const sante = duplicate(this.system.sante)
|
||||
let compteur = sante[name];
|
||||
if (!compteur) {
|
||||
return;
|
||||
}
|
||||
let result = {
|
||||
sonne: false,
|
||||
};
|
||||
|
||||
let minValue = name == "vie" ? -this.getSConst() - 1 : 0;
|
||||
|
||||
result.newValue = Math.max(minValue, Math.min(compteur.value + inc, compteur.max));
|
||||
//console.log("New value ", inc, minValue, result.newValue);
|
||||
let fatigue = 0;
|
||||
if (name == "endurance") {
|
||||
if (result.newValue == 0 && inc < 0 && !isCritique) { // perte endurance et endurance devient 0 (sauf critique) -> -1 vie
|
||||
sante.vie.value--;
|
||||
result.perteVie = true;
|
||||
}
|
||||
result.newValue = Math.max(0, result.newValue);
|
||||
if (inc > 0) { // le max d'endurance s'applique seulement à la récupération
|
||||
result.newValue = Math.min(result.newValue, this._computeEnduranceMax())
|
||||
}
|
||||
const perte = compteur.value - result.newValue;
|
||||
result.perte = perte;
|
||||
if (perte > 1) {
|
||||
// Peut-être sonné si 2 points d'endurance perdus d'un coup
|
||||
mergeObject(result, await this.jetEndurance(result.newValue));
|
||||
} else if (inc > 0) {
|
||||
await this.setSonne(false);
|
||||
}
|
||||
if (sante.fatigue && inc < 0) { // Each endurance lost -> fatigue lost
|
||||
fatigue = perte;
|
||||
}
|
||||
}
|
||||
compteur.value = result.newValue;
|
||||
// If endurance lost, then the same amount of fatigue cannot be recovered
|
||||
if (ReglesOptionnelles.isUsing("appliquer-fatigue") && sante.fatigue && fatigue > 0) {
|
||||
sante.fatigue.value = Math.max(sante.fatigue.value + fatigue, this.getFatigueMin());
|
||||
}
|
||||
await this.update({ "system.sante": sante })
|
||||
if (this.isDead()) {
|
||||
await this.setEffect(STATUSES.StatusComma, true);
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async ajouterBlessure(encaissement, attacker = undefined) {
|
||||
if (encaissement.gravite < 0) return;
|
||||
if (encaissement.gravite > 0) {
|
||||
while (this.countBlessures(it => it.system.gravite == encaissement.gravite) >= RdDItemBlessure.maxBlessures(encaissement.gravite) && encaissement.gravite <= 6) {
|
||||
// Aggravation
|
||||
encaissement.gravite += 2
|
||||
if (encaissement.gravite > 2) {
|
||||
encaissement.vie += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
const endActuelle = this.getEnduranceActuelle();
|
||||
const blessure = await RdDItemBlessure.createBlessure(this, encaissement.gravite, encaissement.dmg.loc.label, attacker);
|
||||
if (blessure.isCritique()) {
|
||||
encaissement.endurance = endActuelle;
|
||||
}
|
||||
|
||||
if (blessure.isMort()) {
|
||||
this.setEffect(STATUSES.StatusComma, true);
|
||||
encaissement.mort = true;
|
||||
ChatMessage.create({
|
||||
content: `<img class="chat-icon" src="icons/svg/skull.svg" alt="charge" />
|
||||
<strong>${this.name} vient de succomber à une seconde blessure critique ! Que les Dragons gardent son Archétype en paix !</strong>`
|
||||
});
|
||||
}
|
||||
return blessure;
|
||||
}
|
||||
|
||||
async supprimerBlessures(filterToDelete) {
|
||||
const toDelete = this.filterItems(filterToDelete, TYPES.blessure)
|
||||
.map(it => it.id);
|
||||
await this.deleteEmbeddedDocuments('Item', toDelete);
|
||||
}
|
||||
|
||||
countBlessures(filter = it => !it.isContusion()) {
|
||||
return this.filterItems(filter, 'blessure').length
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async jetDeVie() {
|
||||
if (this.isDead()) {
|
||||
ChatMessage.create({ content: `Jet de Vie: ${this.name} est déjà mort, ce n'est pas la peine d'en rajouter !!!!!`, whisper: ChatMessage.getWhisperRecipients(this.name) });
|
||||
return
|
||||
}
|
||||
const jetDeVie = await RdDDice.roll("1d20");
|
||||
|
||||
const sConst = this.getSConst();
|
||||
const vie = this.system.sante.vie.value;
|
||||
const isCritique = this.nbBlessuresCritiques() > 0;
|
||||
const isGrave = this.nbBlessuresGraves();
|
||||
const isEchecTotal = jetDeVie.total == 20;
|
||||
const isSuccess = jetDeVie.total == 1 || jetDeVie.total <= vie;
|
||||
const perte = isSuccess ? 0 : 1 + (isEchecTotal ? vie + sConst : 0)
|
||||
const prochainJet = (jetDeVie.total == 1 && vie > 0 ? 20 : 1) * (isCritique ? 1 : isGrave > 0 ? sConst : 0)
|
||||
|
||||
let msgText = `Jet de Vie: <strong>${jetDeVie.total} / ${vie}</strong>`
|
||||
if (isSuccess) {
|
||||
msgText += "<br>Réussi, pas de perte de point de vie."
|
||||
} else {
|
||||
msgText += `<br>Echoué, perte ${perte} point de vie`;
|
||||
await this.santeIncDec("vie", -perte);
|
||||
}
|
||||
if (this.isDead()) {
|
||||
msgText += `<br><strong>${this.name} est mort !!!!</strong>`;
|
||||
}
|
||||
else if (prochainJet > 0) {
|
||||
msgText += `<br>Prochain jet de vie dans ${prochainJet} ${isCritique ? 'round' : 'minute'}${prochainJet > 1 ? 's' : ''} ${isCritique ? '(état critique)' : '(état grave)'}`
|
||||
}
|
||||
ChatMessage.create({ content: msgText, whisper: ChatMessage.getWhisperRecipients(this.name) });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async jetEndurance(resteEndurance = undefined) {
|
||||
const jetEndurance = (await RdDDice.roll("1d20")).total;
|
||||
const sonne = jetEndurance == 20 || jetEndurance > (resteEndurance ?? this.system.sante.endurance.value)
|
||||
if (sonne) {
|
||||
await this.setSonne();
|
||||
}
|
||||
return { jetEndurance, sonne }
|
||||
}
|
||||
|
||||
async finDeRoundBlessures() {
|
||||
const nbGraves = this.filterItems(it => it.isGrave(), 'blessure').length;
|
||||
if (nbGraves > 0) {
|
||||
// Gestion blessure graves : -1 pt endurance par blessure grave
|
||||
await this.santeIncDec("endurance", -nbGraves);
|
||||
}
|
||||
}
|
||||
|
||||
async setSonne(sonne = true) {
|
||||
if (!game.combat && sonne) {
|
||||
ui.notifications.info(`${this.name} est hors combat, il ne reste donc pas sonné`);
|
||||
return;
|
||||
}
|
||||
await this.setEffect(STATUSES.StatusStunned, sonne);
|
||||
}
|
||||
|
||||
getSonne() {
|
||||
return this.getEffect(STATUSES.StatusStunned);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async computeEtatGeneral() {
|
||||
this.system.compteurs.etat.value = this.malusVie() + this.malusFatigue() + this.malusEthylisme();
|
||||
}
|
||||
|
||||
malusVie() {
|
||||
return Math.min(this.system.sante.vie.value - this.system.sante.vie.max, 0);
|
||||
}
|
||||
|
||||
malusEthylisme() { return 0 }
|
||||
|
||||
|
||||
}
|
@ -16,13 +16,10 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
RdDUtility.initAfficheContenu();
|
||||
return mergeObject(super.defaultOptions, {
|
||||
return mergeObject(ActorSheet.defaultOptions, {
|
||||
classes: ["rdd", "sheet", "actor"],
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-sheet.html",
|
||||
width: 550,
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }],
|
||||
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: undefined }],
|
||||
showCompNiveauBase: false,
|
||||
vueDetaillee: false
|
||||
});
|
||||
}
|
||||
@ -31,7 +28,7 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
async getData() {
|
||||
Monnaie.validerMonnaies(this.actor.itemTypes['monnaie']);
|
||||
|
||||
this.actor.recompute();
|
||||
this.actor.computeEtatGeneral();
|
||||
let formData = {
|
||||
title: this.title,
|
||||
id: this.actor.id,
|
||||
@ -135,6 +132,13 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
super.activateListeners(html);
|
||||
this.html = html;
|
||||
|
||||
if (!this.options.editable) return;
|
||||
|
||||
this.html.find('.item-action').click(async event => {
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
item?.actionPrincipale(this.actor, async () => this.render())
|
||||
});
|
||||
|
||||
this.html.find('.conteneur-name a').click(async event => {
|
||||
RdDUtility.toggleAfficheContenu(this.getItemId(event));
|
||||
this.render(true);
|
||||
@ -167,6 +171,26 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
this.html.find('.nettoyer-conteneurs').click(async event => {
|
||||
this.actor.nettoyerConteneurs();
|
||||
});
|
||||
|
||||
this.html.find('.vue-detaillee').click(async event => {
|
||||
this.options.vueDetaillee = !this.options.vueDetaillee;
|
||||
this.render(true);
|
||||
});
|
||||
|
||||
if (this.options.vueDetaillee) {
|
||||
// On carac change
|
||||
this.html.find('.carac-value').change(async event => {
|
||||
let caracName = event.currentTarget.name.replace(".value", "").replace("system.carac.", "");
|
||||
this.actor.updateCarac(caracName, parseInt(event.target.value));
|
||||
});
|
||||
// On competence change
|
||||
this.html.find('.competence-value').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
//console.log("Competence changed :", compName);
|
||||
this.actor.updateCompetence(compName, parseInt(event.target.value));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
_rechercherKeyup(event) {
|
||||
|
@ -1,6 +1,8 @@
|
||||
import { ChatUtility } from "../chat-utility.js";
|
||||
import { SYSTEM_SOCKET_ID } from "../constants.js";
|
||||
import { Grammar } from "../grammar.js";
|
||||
import { Monnaie } from "../item-monnaie.js";
|
||||
import { TYPES } from "../item.js";
|
||||
import { Misc } from "../misc.js";
|
||||
import { RdDAudio } from "../rdd-audio.js";
|
||||
import { RdDConfirm } from "../rdd-confirm.js";
|
||||
@ -9,6 +11,33 @@ import { SystemCompendiums } from "../settings/system-compendiums.js";
|
||||
import { APP_ASTROLOGIE_REFRESH } from "../sommeil/app-astrologie.js";
|
||||
|
||||
export class RdDBaseActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
static _findCaracByName(carac, name) {
|
||||
name = Grammar.toLowerCaseNoAccent(name);
|
||||
switch (name) {
|
||||
case 'reve-actuel': case 'reve actuel':
|
||||
return carac.reve;
|
||||
case 'chance-actuelle': case 'chance actuelle':
|
||||
return carac.chance;
|
||||
}
|
||||
|
||||
const caracList = Object.entries(carac);
|
||||
let entry = Misc.findFirstLike(name, caracList, { mapper: it => it[0], description: 'caractéristique' });
|
||||
if (!entry || entry.length == 0) {
|
||||
entry = Misc.findFirstLike(name, caracList, { mapper: it => it[1].label, description: 'caractéristique' });
|
||||
}
|
||||
return entry && entry.length > 0 ? carac[entry[0]] : undefined;
|
||||
}
|
||||
|
||||
getCaracByName(name) {
|
||||
switch (Grammar.toLowerCaseNoAccent(name)) {
|
||||
case 'reve-actuel': case 'reve actuel':
|
||||
return this.getCaracReveActuel();
|
||||
case 'chance-actuelle': case 'chance-actuelle':
|
||||
return this.getCaracChanceActuelle();
|
||||
}
|
||||
return RdDBaseActor._findCaracByName(this.system.carac, name);
|
||||
}
|
||||
|
||||
static getDefaultImg(itemType) {
|
||||
return game.system.rdd.actorClasses[itemType]?.defaultIcon ?? defaultItemImg[itemType];
|
||||
@ -51,7 +80,7 @@ export class RdDBaseActor extends Actor {
|
||||
static onRemoteActorCall(callData, userId) {
|
||||
if (userId == game.user.id) {
|
||||
let actor = game.actors.get(callData?.actorId);
|
||||
if ( callData.tokenId) {
|
||||
if (callData.tokenId) {
|
||||
let token = canvas.tokens.placeables.find(t => t.id == callData.tokenId)
|
||||
if (token) {
|
||||
actor = token.actor
|
||||
@ -111,11 +140,39 @@ export class RdDBaseActor extends Actor {
|
||||
super(docData, context);
|
||||
}
|
||||
|
||||
isCreatureEntite() { return this.type == 'creature' || this.type == 'entite'; }
|
||||
isCreature() { return this.type == 'creature'; }
|
||||
isEntite() { return this.type == 'entite'; }
|
||||
isPersonnage() { return this.type == 'personnage'; }
|
||||
isVehicule() { return this.type == 'vehicule'; }
|
||||
/* -------------------------------------------- */
|
||||
async _preCreate(data, options, user) {
|
||||
await super._preCreate(data, options, user);
|
||||
|
||||
// Configure prototype token settings
|
||||
const prototypeToken = {};
|
||||
if (this.type === "personnage") Object.assign(prototypeToken, {
|
||||
sight: { enabled: true }, actorLink: true, disposition: CONST.TOKEN_DISPOSITIONS.FRIENDLY
|
||||
});
|
||||
this.updateSource({ prototypeToken });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
prepareData() {
|
||||
super.prepareData()
|
||||
this.prepareActorData()
|
||||
this.cleanupConteneurs()
|
||||
this.computeEtatGeneral()
|
||||
this.computeEncTotal()
|
||||
}
|
||||
|
||||
async prepareActorData() { }
|
||||
async computeEtatGeneral() { }
|
||||
/* -------------------------------------------- */
|
||||
findPlayer() {
|
||||
return game.users.players.find(player => player.active && player.character?.id == this.id);
|
||||
}
|
||||
|
||||
isCreatureEntite() { return this.isCreature() || this.isEntite() }
|
||||
isCreature() { return false }
|
||||
isEntite(typeentite = []) { return false }
|
||||
isVehicule() { return false }
|
||||
isPersonnage() { return false }
|
||||
getItem(id, type = undefined) {
|
||||
const item = this.items.get(id);
|
||||
if (type == undefined || (item?.type == type)) {
|
||||
@ -132,9 +189,7 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
|
||||
getMonnaie(id) { return this.findItemLike(id, 'monnaie'); }
|
||||
|
||||
recompute() { }
|
||||
|
||||
getEncombrementMax() { return 0 }
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async onPreUpdateItem(item, change, options, id) { }
|
||||
@ -163,6 +218,16 @@ export class RdDBaseActor extends Actor {
|
||||
await this.createEmbeddedDocuments('Item', [object])
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async cleanupConteneurs() {
|
||||
let updates = this.itemTypes['conteneur']
|
||||
.filter(c => c.system.contenu.filter(id => this.getItem(id) == undefined).length > 0)
|
||||
.map(c => { return { _id: c._id, 'system.contenu': c.system.contenu.filter(id => this.getItem(id) != undefined) } });
|
||||
if (updates.length > 0) {
|
||||
await this.updateEmbeddedDocuments("Item", updates)
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getFortune() {
|
||||
return Monnaie.getFortune(this.itemTypes['monnaie']);
|
||||
@ -375,14 +440,6 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
computeMalusSurEncombrement() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
getEncombrementMax() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
async computeEncTotal() {
|
||||
if (!this.pack) {
|
||||
this.encTotal = this.items.map(it => it.getEncTotal()).reduce(Misc.sum(), 0);
|
||||
@ -391,6 +448,10 @@ export class RdDBaseActor extends Actor {
|
||||
return 0;
|
||||
}
|
||||
|
||||
getEncTotal() {
|
||||
return Math.floor(this.encTotal ?? 0);
|
||||
}
|
||||
|
||||
async createItem(type, name = undefined) {
|
||||
if (!name) {
|
||||
name = 'Nouveau ' + Misc.typeName('Item', type);
|
||||
@ -619,5 +680,20 @@ export class RdDBaseActor extends Actor {
|
||||
.then(html => ChatMessage.create(RdDUtility.chatDataSetup(html, modeOverride)));
|
||||
}
|
||||
|
||||
actionImpossible(action) {
|
||||
ui.notifications.info(`${this.name} ne peut pas faire cette action: ${action}`)
|
||||
|
||||
}
|
||||
async roll() { this.actionImpossible("jet de caractéristiques") }
|
||||
async jetEthylisme() { this.actionImpossible("jet d'éthylisme") }
|
||||
async rollAppelChance() { this.actionImpossible("appel à la chance") }
|
||||
async jetDeMoral() { this.actionImpossible("jet de moral") }
|
||||
|
||||
async actionPrincipale(item, onActionItem = async () => { }) {
|
||||
switch (item.type) {
|
||||
case TYPES.conteneur: return await item.sheet.render(true);
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
}
|
@ -1,9 +1,7 @@
|
||||
import { DialogItemAchat } from "../dialog-item-achat.js";
|
||||
import { RdDItem } from "../item.js";
|
||||
import { RdDSheetUtility } from "../rdd-sheet-utility.js";
|
||||
import { RdDUtility } from "../rdd-utility.js";
|
||||
import { RdDBaseActorSheet } from "./base-actor-sheet.js";
|
||||
import { RdDCommerce } from "./commerce.js";
|
||||
|
||||
/**
|
||||
* Extend the basic ActorSheet with some very simple modifications
|
||||
@ -14,12 +12,9 @@ export class RdDCommerceSheet extends RdDBaseActorSheet {
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return mergeObject(super.defaultOptions, {
|
||||
classes: ["rdd", "sheet", "actor"],
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor/commerce-actor-sheet.html",
|
||||
width: 600,
|
||||
height: 720,
|
||||
tabs: [],
|
||||
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: undefined }]
|
||||
width: 600, height: 720,
|
||||
tabs: []
|
||||
});
|
||||
}
|
||||
get title() {
|
||||
|
@ -7,18 +7,8 @@ export class RdDCommerce extends RdDBaseActor {
|
||||
return "systems/foundryvtt-reve-de-dragon/icons/services/commerce.webp";
|
||||
}
|
||||
|
||||
prepareData() {
|
||||
super.prepareData();
|
||||
}
|
||||
prepareDerivedData() {
|
||||
super.prepareDerivedData();
|
||||
}
|
||||
|
||||
canReceive(item) {
|
||||
if (item.isInventaire('all')) {
|
||||
return true;
|
||||
}
|
||||
return super.canReceive(item);
|
||||
return item.isInventaire('all');
|
||||
}
|
||||
|
||||
getQuantiteDisponible(item) {
|
||||
|
@ -1,20 +1,16 @@
|
||||
import { RdDActorSheet } from "./actor-sheet.js";
|
||||
import { RdDBaseActorReveSheet } from "./base-actor-reve-sheet.js";
|
||||
|
||||
/**
|
||||
* Extend the basic ActorSheet with some very simple modifications
|
||||
* @extends {ActorSheet}
|
||||
*/
|
||||
export class RdDActorCreatureSheet extends RdDActorSheet {
|
||||
export class RdDCreatureSheet extends RdDBaseActorReveSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return mergeObject(super.defaultOptions, {
|
||||
classes: ["rdd", "sheet", "actor"],
|
||||
return mergeObject(RdDBaseActorReveSheet.defaultOptions, {
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-creature-sheet.html",
|
||||
width: 640,
|
||||
height: 720,
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }],
|
||||
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: undefined }]
|
||||
width: 640, height: 720
|
||||
});
|
||||
}
|
||||
|
66
module/actor/creature.js
Normal file
66
module/actor/creature.js
Normal file
@ -0,0 +1,66 @@
|
||||
import { ENTITE_INCARNE } from "../constants.js";
|
||||
import { TYPES } from "../item.js";
|
||||
import { STATUSES } from "../settings/status-effects.js";
|
||||
import { RdDBaseActorSang } from "./base-actor-sang.js";
|
||||
|
||||
export class RdDCreature extends RdDBaseActorSang {
|
||||
|
||||
static get defaultIcon() {
|
||||
return "systems/foundryvtt-reve-de-dragon/icons/creatures/bramart.svg";
|
||||
}
|
||||
|
||||
isCreature() { return true }
|
||||
|
||||
canReceive(item) {
|
||||
return item.type == TYPES.competencecreature || item.isInventaire();
|
||||
}
|
||||
|
||||
async remiseANeuf() {
|
||||
await this.removeEffects(e => true);
|
||||
await this.supprimerBlessures(it => true);
|
||||
const updates = {
|
||||
'system.sante.endurance.value': this.system.sante.endurance.max,
|
||||
'system.sante.vie.value': this.system.sante.vie.max,
|
||||
'system.sante.fatigue.value': 0
|
||||
};
|
||||
await this.update(updates);
|
||||
}
|
||||
|
||||
async finDeRoundBlessures() {
|
||||
const nbGraves = this.filterItems(it => it.isGrave(), 'blessure').length;
|
||||
if (nbGraves > 0) {
|
||||
// Gestion blessure graves : -1 pt endurance par blessure grave
|
||||
await this.santeIncDec("endurance", -nbGraves);
|
||||
}
|
||||
}
|
||||
|
||||
isEffectAllowed(statusId) {
|
||||
return [STATUSES.StatusComma].includes(statusId);
|
||||
}
|
||||
|
||||
isEntiteAccordee(attacker) {
|
||||
if (this.isEntite([ENTITE_INCARNE])) {
|
||||
let resonnance = this.system.sante.resonnance
|
||||
return (resonnance.actors.find(it => it == attacker.id))
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async setEntiteReveAccordee(attacker) {
|
||||
if (this.isEntite([ENTITE_INCARNE])) {
|
||||
let resonnance = duplicate(this.system.sante.resonnance);
|
||||
if (resonnance.actors.find(it => it == attacker.id)) {
|
||||
// déjà accordé
|
||||
return;
|
||||
}
|
||||
resonnance.actors.push(attacker.id);
|
||||
await this.update({ "system.sante.resonnance": resonnance });
|
||||
}
|
||||
else {
|
||||
super.setEntiteReveAccordee(attacker)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,20 +1,17 @@
|
||||
import { RdDActorSheet } from "./actor-sheet.js";
|
||||
import { RdDSheetUtility } from "./rdd-sheet-utility.js";
|
||||
import { RdDUtility } from "./rdd-utility.js";
|
||||
import { RdDBaseActorReveSheet } from "./base-actor-reve-sheet.js";
|
||||
import { RdDSheetUtility } from "../rdd-sheet-utility.js";
|
||||
import { RdDUtility } from "../rdd-utility.js";
|
||||
|
||||
export class RdDActorEntiteSheet extends RdDActorSheet {
|
||||
export class RdDActorEntiteSheet extends RdDBaseActorReveSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return mergeObject(super.defaultOptions, {
|
||||
classes: ["rdd", "sheet", "actor"],
|
||||
return mergeObject(RdDBaseActorReveSheet.defaultOptions, {
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-entite-sheet.html",
|
||||
width: 640,
|
||||
height: 720,
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }],
|
||||
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: undefined }]
|
||||
width: 640, height: 720,
|
||||
});
|
||||
}
|
||||
|
||||
async getData() {
|
||||
let formData = await super.getData();
|
||||
formData.resonances = this.actor.system.sante.resonnance.actors.map(actorId => game.actors.get(actorId))
|
110
module/actor/entite.js
Normal file
110
module/actor/entite.js
Normal file
@ -0,0 +1,110 @@
|
||||
import { ENTITE_INCARNE, ENTITE_NONINCARNE } from "../constants.js";
|
||||
import { TYPES } from "../item.js";
|
||||
import { Misc } from "../misc.js";
|
||||
import { RdDEncaisser } from "../rdd-roll-encaisser.js";
|
||||
import { STATUSES } from "../settings/status-effects.js";
|
||||
import { RdDBaseActorReve } from "./base-actor-reve.js";
|
||||
|
||||
export class RdDEntite extends RdDBaseActorReve {
|
||||
|
||||
static get defaultIcon() {
|
||||
return "systems/foundryvtt-reve-de-dragon/icons/entites/darquoine.webp";
|
||||
}
|
||||
|
||||
canReceive(item) {
|
||||
return item.type == TYPES.competencecreature
|
||||
}
|
||||
|
||||
isEntite(typeentite = []) {
|
||||
return (typeentite.length == 0 || typeentite.includes(this.system.definition.typeentite));
|
||||
}
|
||||
isNonIncarnee() { return this.isEntite([ENTITE_NONINCARNE]) }
|
||||
|
||||
getReveActuel() {
|
||||
return Misc.toInt(this.system.carac.reve?.value)
|
||||
}
|
||||
|
||||
getForce() { return this.getReve() }
|
||||
getAgilite() { return this.getReve() }
|
||||
getChance() { return this.getReve() }
|
||||
|
||||
getDraconicOuPossession() {
|
||||
return this.itemTypes[TYPES.competencecreature]
|
||||
.filter(it => it.system.categorie == 'possession')
|
||||
.sort(Misc.descending(it => it.system.niveau))
|
||||
.find(it => true);
|
||||
}
|
||||
|
||||
async remiseANeuf() {
|
||||
await this.removeEffects(e => true);
|
||||
if (!this.isNonIncarnee()) {
|
||||
await this.update({
|
||||
'system.sante.endurance.value': this.system.sante.endurance.max
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
isDead() {
|
||||
return this.isNonIncarnee() ? false : this.system.sante.endurance.value <= 0
|
||||
}
|
||||
|
||||
async santeIncDec(name, inc, isCritique = false) {
|
||||
if (name == 'endurance' && !this.isNonIncarnee()) {
|
||||
const oldValue = this.system.sante.endurance.value;
|
||||
const endurance = Math.max(0,
|
||||
Math.min(oldValue + inc,
|
||||
this.system.sante.endurance.max));
|
||||
await this.update({ "system.sante.endurance.value": endurance })
|
||||
await this.setEffect(STATUSES.StatusComma, endurance <= 0);
|
||||
return {
|
||||
perte: oldValue - endurance,
|
||||
newValue: endurance
|
||||
}
|
||||
}
|
||||
return {}
|
||||
}
|
||||
async encaisser() {
|
||||
if (this.isNonIncarnee()) {
|
||||
return
|
||||
}
|
||||
await RdDEncaisser.encaisser(this)
|
||||
}
|
||||
|
||||
isEffectAllowed(statusId) {
|
||||
return [STATUSES.StatusComma].includes(statusId);
|
||||
}
|
||||
|
||||
async onAppliquerJetEncaissement(encaissement, attacker) {
|
||||
const perteEndurance = await this.santeIncDec("endurance", -encaissement.endurance);
|
||||
mergeObject(encaissement, {
|
||||
resteEndurance: perteEndurance.newValue,
|
||||
endurance: perteEndurance.perte
|
||||
});
|
||||
}
|
||||
|
||||
isEntiteAccordee(attacker) {
|
||||
if (this.isEntite([ENTITE_INCARNE])) {
|
||||
let resonnance = this.system.sante.resonnance
|
||||
return (resonnance.actors.find(it => it == attacker.id))
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async setEntiteReveAccordee(attacker) {
|
||||
if (this.isEntite([ENTITE_INCARNE])) {
|
||||
let resonnance = duplicate(this.system.sante.resonnance);
|
||||
if (resonnance.actors.find(it => it == attacker.id)) {
|
||||
// déjà accordé
|
||||
return;
|
||||
}
|
||||
resonnance.actors.push(attacker.id);
|
||||
await this.update({ "system.sante.resonnance": resonnance });
|
||||
}
|
||||
else {
|
||||
super.setEntiteReveAccordee(attacker)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,23 +1,35 @@
|
||||
import { RdDUtility } from "./rdd-utility.js";
|
||||
import { RdDActorSheet } from "./actor-sheet.js";
|
||||
import { RdDUtility } from "../rdd-utility.js";
|
||||
import { RdDBaseActorSheet } from "./base-actor-sheet.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class RdDActorVehiculeSheet extends RdDActorSheet {
|
||||
export class RdDActorVehiculeSheet extends RdDBaseActorSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
RdDUtility.initAfficheContenu();
|
||||
|
||||
return mergeObject(super.defaultOptions, {
|
||||
classes: ["rdd", "sheet", "actor"],
|
||||
return mergeObject(RdDBaseActorSheet.defaultOptions, {
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.html",
|
||||
width: 640,
|
||||
height: 720,
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }],
|
||||
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: undefined }]
|
||||
width: 640, height: 720,
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
let formData = await super.getData();
|
||||
mergeObject(formData,
|
||||
{
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
effects: this.actor.effects.map(e => foundry.utils.deepClone(e)),
|
||||
limited: this.actor.limited,
|
||||
owner: this.actor.isOwner,
|
||||
});
|
||||
|
||||
this.timerRecherche = undefined;
|
||||
return formData;
|
||||
}
|
||||
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
if (!this.options.editable) return;
|
28
module/actor/vehicule.js
Normal file
28
module/actor/vehicule.js
Normal file
@ -0,0 +1,28 @@
|
||||
import { RdDBaseActor } from "./base-actor.js";
|
||||
|
||||
export class RdDVehicule extends RdDBaseActor {
|
||||
|
||||
static get defaultIcon() {
|
||||
return "systems/foundryvtt-reve-de-dragon/icons/vehicules/charette.webp";
|
||||
}
|
||||
isVehicule() { return true }
|
||||
|
||||
canReceive(item) {
|
||||
return item.isInventaire();
|
||||
}
|
||||
|
||||
getEncombrementMax() {
|
||||
return this.system.capacite_encombrement;
|
||||
}
|
||||
|
||||
async vehicleIncDec(name, inc) {
|
||||
if (!['resistance', 'structure'].includes(name)) {
|
||||
return
|
||||
}
|
||||
const newValue = this.system.etat[name].value + inc;
|
||||
if (0 <= newValue && newValue <= this.system.etat[name].max) {
|
||||
await this.update({ [`system.etat.${name}.value`]: newValue })
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -14,7 +14,7 @@ export class DialogCreateSigneDraconique extends Dialog {
|
||||
.map(actor => ({
|
||||
id: actor.id,
|
||||
name: actor.name,
|
||||
selected: true
|
||||
selected: false
|
||||
}))
|
||||
};
|
||||
|
||||
|
@ -7,20 +7,19 @@ import { RdDUtility } from "./rdd-utility.js";
|
||||
*/
|
||||
export class DialogValidationEncaissement extends Dialog {
|
||||
|
||||
static async validerEncaissement(actor, rollData, armure, show, attackerId, onEncaisser) {
|
||||
static async validerEncaissement(actor, rollData, armure, onEncaisser) {
|
||||
let encaissement = await RdDUtility.jetEncaissement(rollData, armure, { showDice: HIDE_DICE });
|
||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-validation-encaissement.html', {
|
||||
actor: actor,
|
||||
rollData: rollData,
|
||||
encaissement: encaissement,
|
||||
show: show
|
||||
encaissement: encaissement
|
||||
});
|
||||
const dialog = new DialogValidationEncaissement(html, actor, rollData, armure, encaissement, show, attackerId, onEncaisser);
|
||||
const dialog = new DialogValidationEncaissement(html, actor, rollData, armure, encaissement, onEncaisser);
|
||||
dialog.render(true);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
constructor(html, actor, rollData, armure, encaissement, show, attackerId, onEncaisser) {
|
||||
constructor(html, actor, rollData, armure, encaissement, onEncaisser) {
|
||||
// Common conf
|
||||
let buttons = {
|
||||
"valider": { label: "Valider", callback: html => this.onValider() },
|
||||
@ -47,8 +46,6 @@ export class DialogValidationEncaissement extends Dialog {
|
||||
this.rollData = rollData;
|
||||
this.armure = armure;
|
||||
this.encaissement = encaissement;
|
||||
this.show = show;
|
||||
this.attackerId = attackerId;
|
||||
this.onEncaisser = onEncaisser;
|
||||
this.forceDiceResult = {total: encaissement.roll.result };
|
||||
}
|
||||
@ -67,6 +64,6 @@ export class DialogValidationEncaissement extends Dialog {
|
||||
|
||||
async onValider() {
|
||||
this.encaissement = await RdDUtility.jetEncaissement(this.rollData, this.armure, { showDice: SHOW_DICE, forceDiceResult: this.forceDiceResult});
|
||||
this.onEncaisser(this.encaissement, this.show, this.attackerId)
|
||||
this.onEncaisser(this.encaissement)
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ const nomCategorieParade = {
|
||||
export class RdDItemArme extends Item {
|
||||
|
||||
static isArme(item) {
|
||||
return RdDItemCompetenceCreature.getCategorieAttaque(item) || item.type == TYPES.arme;
|
||||
return item.type == TYPES.arme || RdDItemCompetenceCreature.getCategorieAttaque(item);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -55,6 +55,20 @@ export class RdDItemCompetenceCreature extends Item {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static isCompetenceAttaque(item) {
|
||||
if (item.type == TYPES.competencecreature) {
|
||||
switch (item.system.categorie) {
|
||||
case "melee":
|
||||
case "tir":
|
||||
case "lancer":
|
||||
case "naturelle":
|
||||
case "possession":
|
||||
return true
|
||||
}
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
static getCategorieAttaque(item) {
|
||||
if (item.type == TYPES.competencecreature) {
|
||||
switch (item.system.categorie) {
|
||||
@ -63,6 +77,7 @@ export class RdDItemCompetenceCreature extends Item {
|
||||
case "lancer":
|
||||
case "naturelle":
|
||||
case "possession":
|
||||
case "parade":
|
||||
return item.system.categorie
|
||||
}
|
||||
}
|
||||
|
@ -195,7 +195,8 @@ export class RdDItemSheet extends ItemSheet {
|
||||
|
||||
this.html.find('.creer-tache-livre').click((event) => this._getEventActor(event).creerTacheDepuisLivre(this.item));
|
||||
this.html.find('.consommer-potion').click((event) => this._getEventActor(event).consommerPotion(this.item, this.getActionRenderItem()));
|
||||
this.html.find('.creer-potion-base').click((event) => this._getEventActor(event).dialogFabriquerPotion(this.item));
|
||||
this.html.find('.creer-potion-base').click((event) => this._getEventActor(event).actionHerbe(this.item));
|
||||
this.html.find('input[name="system.cacher_points_de_tache"]').change(async event => await this.item.update({ 'system.cacher_points_de_tache': event.currentTarget.checked }));
|
||||
|
||||
this.html.find('.alchimie-tache a').click((event) => {
|
||||
let actor = this._getEventActor(event);
|
||||
@ -256,7 +257,7 @@ export class RdDItemSheet extends ItemSheet {
|
||||
|
||||
if (this.item.isCompetence()) {
|
||||
const categorie = event.currentTarget.value;
|
||||
const level = RdDItemCompetence.getNiveauBase(categorie, this.item.getCategories());
|
||||
const level = RdDItemCompetence.getNiveauBase(categorie, this.item.getCategories());
|
||||
this.item.system.base = level;
|
||||
this.html.find('[name="system.base"]').val(level);
|
||||
}
|
||||
|
@ -498,11 +498,11 @@ export class RdDItem extends Item {
|
||||
if (this.actor?.isPersonnage()) {
|
||||
const warn = options.warnIfNot;
|
||||
if (this.getUtilisationCuisine() == 'brut') {
|
||||
return 'Utiliser';
|
||||
return 'Cuisiner';
|
||||
}
|
||||
switch (this.type) {
|
||||
case TYPES.nourritureboisson: return this._actionOrWarnQuantiteZero(this.system.boisson ? 'Boire' : 'Manger', warn);
|
||||
case TYPES.potion: return this._actionOrWarnQuantiteZero('Boire', warn);
|
||||
case TYPES.potion: return this._actionOrWarnQuantiteZero('Consommer', warn);
|
||||
case TYPES.livre: return this._actionOrWarnQuantiteZero('Lire', warn);
|
||||
case TYPES.herbe: return this.isHerbeAPotion() ? this._actionOrWarnQuantiteZero('Décoction', warn) : undefined;
|
||||
case TYPES.queue: case TYPES.ombre: return this.system.refoulement > 0 ? 'Refouler' : undefined;
|
||||
@ -513,19 +513,8 @@ export class RdDItem extends Item {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async actionPrincipale(actor, onActionItem = async () => { }) {
|
||||
if (!this.getActionPrincipale()) {
|
||||
return;
|
||||
}
|
||||
if (await actor.actionNourritureboisson(this, onActionItem)) {
|
||||
return;
|
||||
}
|
||||
switch (this.type) {
|
||||
case TYPES.potion: return await actor.consommerPotion(this, onActionItem);
|
||||
case TYPES.livre: return await actor.actionLire(this);
|
||||
case TYPES.conteneur: return await this.sheet.render(true);
|
||||
case TYPES.herbe: return await actor.actionHerbe(this, onActionItem);
|
||||
case TYPES.queue: case TYPES.ombre: return await actor.actionRefoulement(this);
|
||||
}
|
||||
if (!this.getActionPrincipale()) { return }
|
||||
await actor?.actionPrincipale(this, onActionItem);
|
||||
}
|
||||
|
||||
_actionOrWarnQuantiteZero(actionName, warn) {
|
||||
@ -808,7 +797,7 @@ export class RdDItem extends Item {
|
||||
`<b>Périodicité</b>: ${this.system.periodicite}`,
|
||||
`<b>Fatigue</b>: ${this.system.fatigue}`,
|
||||
`<b>Difficulté</b>: ${this.system.difficulte}`,
|
||||
RdDItem.propertyIfDefined('Points de Tâche', this.system.points_de_tache, this.system.cacher_points_de_tache),
|
||||
RdDItem.propertyIfDefined('Points de Tâche', this.system.points_de_tache, !this.system.cacher_points_de_tache),
|
||||
`<b>Points de Tâche atteints</b>: ${this.system.points_de_tache_courant}`]
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
@ -817,7 +806,7 @@ export class RdDItem extends Item {
|
||||
`<b>Compétence</b>: ${this.system.competence}`,
|
||||
`<b>Auteur</b>: ${this.system.auteur}`,
|
||||
`<b>Difficulté</b>: ${this.system.difficulte}`,
|
||||
RdDItem.propertyIfDefined('Points de Tâche', this.system.points_de_tache, this.system.cacher_points_de_tache),
|
||||
RdDItem.propertyIfDefined('Points de Tâche', this.system.points_de_tache, !this.system.cacher_points_de_tache),
|
||||
...this._inventaireTemplateChatData()
|
||||
]
|
||||
}
|
||||
|
@ -115,7 +115,10 @@ export class RdDItemBlessure extends RdDItem {
|
||||
if (!isMaladeEmpoisonne && rolled.isSuccess && this.peutRetrograder(graviteMoindre, moindres)) {
|
||||
message.content += ` -- une blessure ${label} cicatrise`;
|
||||
mergeObject(update, {
|
||||
system: { gravite: graviteMoindre, fin: { indexDate: timestamp.addJours(graviteMoindre).indexDate } }
|
||||
system: {
|
||||
gravite: graviteMoindre,
|
||||
temporel: { fin: { indexDate: timestamp.addJours(graviteMoindre).indexDate } }
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
@ -63,8 +63,8 @@ export class Misc {
|
||||
|
||||
static keepDecimals(num, decimals) {
|
||||
if (decimals <= 0 || decimals > 6) return num;
|
||||
const decimal = Math.pow(10, parseInt(decimals));
|
||||
return Math.round(num * decimal) / decimal;
|
||||
const power10n = Math.pow(10, parseInt(decimals));
|
||||
return Math.round(num * power10n) / power10n;
|
||||
}
|
||||
|
||||
static getFractionHtml(diviseur) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Grammar } from "./grammar.js";
|
||||
import { Misc } from "./misc.js";
|
||||
|
||||
const tableCaracDerivee = {
|
||||
const TABLE_CARACTERISTIQUES_DERIVEES = {
|
||||
// xp: coût pour passer du niveau inférieur à ce niveau
|
||||
1: { xp: 3, poids: "moins de 1kg", plusdom: -5, sconst: 0.5, sust: 0.1 },
|
||||
2: { xp: 3, poids: "1-5", plusdom: -4, sconst: 0.5, sust: 0.3 },
|
||||
@ -58,6 +58,10 @@ export class RdDCarac {
|
||||
selectedCarac?.label.match(/(Apparence|Force|Agilité|Dextérité|Vue|Ouïe|Odorat-Goût|Empathie|Dérobée|Mêlée|Tir|Lancer)/);
|
||||
}
|
||||
|
||||
static getCaracDerivee(value) {
|
||||
return TABLE_CARACTERISTIQUES_DERIVEES[Math.min(Math.max(Number(value), 1), 32)];
|
||||
}
|
||||
|
||||
static computeTotal(carac, beaute = undefined) {
|
||||
const total = Object.values(carac ?? {}).filter(c => !c.derivee)
|
||||
.map(it => parseInt(it.value))
|
||||
@ -73,7 +77,7 @@ export class RdDCarac {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static calculSConst(constitution) {
|
||||
return Number(tableCaracDerivee[Number(constitution)].sconst);
|
||||
return RdDCarac.getCaracDerivee(constitution).sconst;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -84,7 +88,7 @@ export class RdDCarac {
|
||||
}
|
||||
|
||||
static getCaracXp(targetValue) {
|
||||
return tableCaracDerivee[targetValue]?.xp ?? 200;
|
||||
return RdDCarac.getCaracDerivee(targetValue)?.xp ?? 200;
|
||||
}
|
||||
|
||||
|
||||
@ -97,37 +101,4 @@ export class RdDCarac {
|
||||
return Grammar.toLowerCaseNoAccent(selectedCarac?.label)?.match(/(apparence|force|agilite|dexterite|vue|ouie|odorat|empathie|melee|tir|lancer|derobee)/);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static computeCarac(system) {
|
||||
system.carac.force.value = Math.min(system.carac.force.value, parseInt(system.carac.taille.value) + 4);
|
||||
|
||||
system.carac.derobee.value = Math.floor(parseInt(((21 - system.carac.taille.value)) + parseInt(system.carac.agilite.value)) / 2);
|
||||
let bonusDomKey = Math.floor((parseInt(system.carac.force.value) + parseInt(system.carac.taille.value)) / 2);
|
||||
bonusDomKey = Math.min(Math.max(bonusDomKey, 0), 32); // Clamp de securite
|
||||
|
||||
let tailleData = tableCaracDerivee[bonusDomKey];
|
||||
system.attributs.plusdom.value = tailleData.plusdom;
|
||||
|
||||
system.attributs.sconst.value = RdDCarac.calculSConst(system.carac.constitution.value);
|
||||
system.attributs.sust.value = tableCaracDerivee[Number(system.carac.taille.value)].sust;
|
||||
|
||||
system.attributs.encombrement.value = (parseInt(system.carac.force.value) + parseInt(system.carac.taille.value)) / 2;
|
||||
system.carac.melee.value = Math.floor((parseInt(system.carac.force.value) + parseInt(system.carac.agilite.value)) / 2);
|
||||
system.carac.tir.value = Math.floor((parseInt(system.carac.vue.value) + parseInt(system.carac.dexterite.value)) / 2);
|
||||
system.carac.lancer.value = Math.floor((parseInt(system.carac.tir.value) + parseInt(system.carac.force.value)) / 2);
|
||||
|
||||
system.sante.vie.max = Math.ceil((parseInt(system.carac.taille.value) + parseInt(system.carac.constitution.value)) / 2);
|
||||
|
||||
system.sante.vie.value = Math.min(system.sante.vie.value, system.sante.vie.max)
|
||||
system.sante.endurance.max = Math.max(parseInt(system.carac.taille.value) + parseInt(system.carac.constitution.value), parseInt(system.sante.vie.max) + parseInt(system.carac.volonte.value));
|
||||
system.sante.endurance.value = Math.min(system.sante.endurance.value, system.sante.endurance.max);
|
||||
system.sante.fatigue.max = system.sante.endurance.max * 2;
|
||||
system.sante.fatigue.value = Math.min(system.sante.fatigue.value, system.sante.fatigue.max);
|
||||
|
||||
//Compteurs
|
||||
system.reve.reve.max = system.carac.reve.value;
|
||||
system.compteurs.chance.max = system.carac.chance.value;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ export class RdDCombatManager extends Combat {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************************/
|
||||
async rollInitiative(ids, formula = undefined, messageOptions = {}) {
|
||||
console.log(`${game.system.title} | Combat.rollInitiative()`, ids, formula, messageOptions);
|
||||
@ -87,7 +87,7 @@ export class RdDCombatManager extends Combat {
|
||||
let rollFormula = formula ?? RdDCombatManager.formuleInitiative(2, 10, 0, 0);
|
||||
if (!formula) {
|
||||
if (combatant.actor.type == 'creature' || combatant.actor.type == 'entite') {
|
||||
const competence = combatant.actor.items.find(it => RdDItemCompetenceCreature.getCategorieAttaque(it))
|
||||
const competence = combatant.actor.items.find(it => RdDItemCompetenceCreature.isCompetenceAttaque(it))
|
||||
if (competence) {
|
||||
rollFormula = RdDCombatManager.formuleInitiative(2, competence.system.carac_value, competence.system.niveau, 0);
|
||||
}
|
||||
@ -229,7 +229,9 @@ export class RdDCombatManager extends Combat {
|
||||
}
|
||||
|
||||
static listActionsCreature(competences) {
|
||||
return competences.map(it => RdDItemCompetenceCreature.armeCreature(it))
|
||||
return competences
|
||||
.filter(it => RdDItemCompetenceCreature.isCompetenceAttaque(it))
|
||||
.map(it => RdDItemCompetenceCreature.armeCreature(it))
|
||||
.filter(it => it != undefined);
|
||||
}
|
||||
|
||||
@ -448,7 +450,7 @@ export class RdDCombat {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
let turn = combat.turns.find(t => t.token?.id == combat.current.tokenId);
|
||||
if (turn?.actor) {
|
||||
RdDCombat.displayActorCombatStatus(combat, turn.actor);
|
||||
RdDCombat.displayActorCombatStatus(combat, turn.actor, turn.token.id);
|
||||
// TODO Playaudio for player??
|
||||
}
|
||||
}
|
||||
@ -512,8 +514,12 @@ export class RdDCombat {
|
||||
/* -------------------------------------------- */
|
||||
static _callJetDeVie(event) {
|
||||
let actorId = event.currentTarget.attributes['data-actorId'].value;
|
||||
let actor = game.actors.get(actorId);
|
||||
actor.jetVie();
|
||||
let tokenId = event.currentTarget.attributes['data-tokenId'].value;
|
||||
let token = canvas.tokens.placeables.find(t => t.id == tokenId)
|
||||
const actor = token?.actor ?? game.actors.get(actorId);
|
||||
if (actor?.isOwner) {
|
||||
actor.jetDeVie();
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -539,7 +545,7 @@ export class RdDCombat {
|
||||
}
|
||||
});
|
||||
}
|
||||
html.on("click", '#chat-jet-vie', event => {
|
||||
html.on("click", 'a.chat-jet-vie', event => {
|
||||
event.preventDefault();
|
||||
RdDCombat._callJetDeVie(event);
|
||||
});
|
||||
@ -818,8 +824,8 @@ export class RdDCombat {
|
||||
// finesse seulement en mélée, pour l'empoignade, ou si la difficulté libre est de -1 minimum
|
||||
// rapidité seulement en mêlée, si l'arme le permet, et si la difficulté libre est de -1 minimum
|
||||
const isForce = !rollData.arme.system.empoignade;
|
||||
const isFinesse = rollData.arme.system.empoignade || isMeleeDiffNegative;
|
||||
const isRapide = !rollData.arme.system.empoignade && isMeleeDiffNegative && rollData.arme.system.rapide;
|
||||
const isFinesse = rollData.tactique != 'charge' && (rollData.arme.system.empoignade || isMeleeDiffNegative);
|
||||
const isRapide = rollData.tactique != 'charge' && !rollData.arme.system.empoignade && isMeleeDiffNegative && rollData.arme.system.rapide;
|
||||
// si un seul choix possible, le prendre
|
||||
if (isForce && !isFinesse && !isRapide) {
|
||||
return await this.choixParticuliere(rollData, "force");
|
||||
@ -1292,7 +1298,7 @@ export class RdDCombat {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async displayActorCombatStatus(combat, actor) {
|
||||
static async displayActorCombatStatus(combat, actor, tokenId) {
|
||||
let formData = {
|
||||
combatId: combat._id,
|
||||
alias: actor.name,
|
||||
@ -1301,12 +1307,18 @@ export class RdDCombat {
|
||||
blessuresStatus: actor.computeResumeBlessure(),
|
||||
SConst: actor.getSConst(),
|
||||
actorId: actor.id,
|
||||
tokenId: tokenId,
|
||||
isGrave: actor.countBlessures(it => it.isGrave()) > 0,
|
||||
isCritique: actor.countBlessures(it => it.isCritique()) > 0
|
||||
}
|
||||
|
||||
ChatUtility.createChatWithRollMode(actor.name, {
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-turn-summary.html`, formData)
|
||||
await ChatMessage.create({
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-turn-acteur.hbs`, formData),
|
||||
alias: actor.name
|
||||
});
|
||||
await ChatMessage.create({
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-turn-sante.hbs`, formData),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(actor.name),
|
||||
alias: actor.name
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -29,11 +29,13 @@ import { Environnement } from "./environnement.js";
|
||||
import { RdDActor } from "./actor.js";
|
||||
import { RdDBaseActor } from "./actor/base-actor.js";
|
||||
import { RdDCommerce } from "./actor/commerce.js";
|
||||
import { RdDEntite } from "./actor/entite.js";
|
||||
import { RdDVehicule } from "./actor/vehicule.js";
|
||||
import { RdDActorSheet } from "./actor-sheet.js";
|
||||
import { RdDCommerceSheet } from "./actor/commerce-sheet.js";
|
||||
import { RdDActorCreatureSheet } from "./actor-creature-sheet.js";
|
||||
import { RdDActorVehiculeSheet } from "./actor-vehicule-sheet.js";
|
||||
import { RdDActorEntiteSheet } from "./actor-entite-sheet.js";
|
||||
import { RdDCreatureSheet } from "./actor/creature-sheet.js";
|
||||
import { RdDActorEntiteSheet } from "./actor/entite-sheet.js";
|
||||
import { RdDActorVehiculeSheet } from "./actor/vehicule-sheet.js";
|
||||
|
||||
import { RdDItem } from "./item.js";
|
||||
import { RdDItemBlessure } from "./item/blessure.js";
|
||||
@ -60,6 +62,7 @@ import { RdDItemInventaireSheet } from "./item/sheet-base-inventaire.js";
|
||||
import { AppAstrologie } from "./sommeil/app-astrologie.js";
|
||||
import { RdDItemArmure } from "./item/armure.js";
|
||||
import { AutoAdjustDarkness as AutoAdjustDarkness } from "./time/auto-adjust-darkness.js";
|
||||
import { RdDCreature } from "./actor/creature.js";
|
||||
|
||||
/**
|
||||
* RdD system
|
||||
@ -91,10 +94,10 @@ export class SystemReveDeDragon {
|
||||
}
|
||||
this.actorClasses = {
|
||||
commerce: RdDCommerce,
|
||||
creature: RdDActor,
|
||||
entite: RdDActor,
|
||||
creature: RdDCreature,
|
||||
entite: RdDEntite,
|
||||
personnage: RdDActor,
|
||||
vehicule: RdDActor,
|
||||
vehicule: RdDVehicule,
|
||||
}
|
||||
}
|
||||
|
||||
@ -150,7 +153,7 @@ export class SystemReveDeDragon {
|
||||
Actors.unregisterSheet("core", ActorSheet);
|
||||
Actors.registerSheet(SYSTEM_RDD, RdDCommerceSheet, { types: ["commerce"], makeDefault: true });
|
||||
Actors.registerSheet(SYSTEM_RDD, RdDActorSheet, { types: ["personnage"], makeDefault: true });
|
||||
Actors.registerSheet(SYSTEM_RDD, RdDActorCreatureSheet, { types: ["creature"], makeDefault: true });
|
||||
Actors.registerSheet(SYSTEM_RDD, RdDCreatureSheet, { types: ["creature"], makeDefault: true });
|
||||
Actors.registerSheet(SYSTEM_RDD, RdDActorVehiculeSheet, { types: ["vehicule"], makeDefault: true });
|
||||
Actors.registerSheet(SYSTEM_RDD, RdDActorEntiteSheet, { types: ["entite"], makeDefault: true });
|
||||
Items.unregisterSheet("core", ItemSheet);
|
||||
|
@ -28,7 +28,7 @@ const reussites = [
|
||||
|
||||
const reussiteInsuffisante = { code: "notSign", isPart: false, isSign: false, isSuccess: false, isEchec: true, isEPart: false, isETotal: false, ptTache: 0, ptQualite: -2, quality: "Réussite insuffisante", condition: (target, roll) => false }
|
||||
/* -------------------------------------------- */
|
||||
const caracMaximumResolution = 60;
|
||||
const CARAC_MAXIMUM_RESOLUTION = 40;
|
||||
/* -------------------------------------------- */
|
||||
export class RdDResolutionTable {
|
||||
static resolutionTable = this.build()
|
||||
@ -36,7 +36,7 @@ export class RdDResolutionTable {
|
||||
/* -------------------------------------------- */
|
||||
static build() {
|
||||
let table = []
|
||||
for (var caracValue = 0; caracValue <= caracMaximumResolution; caracValue++) {
|
||||
for (var caracValue = 0; caracValue <= CARAC_MAXIMUM_RESOLUTION; caracValue++) {
|
||||
table[caracValue] = this._computeRow(caracValue);
|
||||
}
|
||||
return table;
|
||||
|
@ -22,7 +22,7 @@ export class RdDRoll extends Dialog {
|
||||
|
||||
const html = await renderTemplate(dialogConfig.html, rollData);
|
||||
|
||||
let options = { classes: ["rdd-roll-dialog"], width: 600, height: 'fit-content', 'z-index': 99999, close: html => {} };
|
||||
let options = { classes: ["rdd-roll-dialog"], width: 650, height: 'fit-content', 'z-index': 99999, close: html => {} };
|
||||
if (dialogConfig.close) {
|
||||
options.close = dialogConfig.close;
|
||||
}
|
||||
@ -50,8 +50,6 @@ export class RdDRoll extends Dialog {
|
||||
encTotal: true
|
||||
},
|
||||
isMalusEncombrementTotal: RdDItemCompetence.isMalusEncombrementTotal(rollData.competence),
|
||||
malusArmureValue: actor.getMalusArmure(),
|
||||
surencMalusValue: actor.computeMalusSurEncombrement(),
|
||||
encTotal: actor.getEncTotal(),
|
||||
ajustementAstrologique: actor.ajustementAstrologique(),
|
||||
surprise: actor.getSurprise(false),
|
||||
@ -187,7 +185,7 @@ export class RdDRoll extends Dialog {
|
||||
console.log("RdDRollSelectDialog - Cout reve", ptreve);
|
||||
this.updateRollResult(html);
|
||||
});
|
||||
this.html.find("[name='mortalite']").change((event) => {
|
||||
this.html.find("input.check-mortalite").change((event) => {
|
||||
this.rollData.dmg.mortalite = event.currentTarget.checked ? "non-mortel" : "mortel";
|
||||
this.updateRollResult(html);
|
||||
});
|
||||
@ -291,34 +289,31 @@ export class RdDRoll extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async updateRollResult(html) {
|
||||
let rollData = this.rollData;
|
||||
const rollData = this.rollData;
|
||||
|
||||
rollData.dmg = rollData.attackerRoll?.dmg ?? RdDBonus.dmg(rollData, this.actor.getBonusDegat())
|
||||
rollData.caracValue = parseInt(rollData.selectedCarac.value)
|
||||
rollData.mortalite = rollData.attackerRoll?.dmg.mortalite ?? rollData.dmg.mortalite ?? rollData.mortalite ?? 'mortel';
|
||||
rollData.dmg.mortalite = rollData.dmg.mortalite ?? 'mortel';
|
||||
rollData.use.appelAuMoral = this.actor.isPersonnage() && RdDCarac.isActionPhysique(rollData.selectedCarac);
|
||||
let dmgText = Misc.toSignedString(rollData.dmg.total);
|
||||
|
||||
switch (rollData.mortalite) {
|
||||
case 'non-mortel': dmgText = `(${dmgText}) non-mortel`; break;
|
||||
case 'empoignade': dmgText = `empoignade`; break;
|
||||
}
|
||||
|
||||
RollDataAjustements.calcul(rollData, this.actor);
|
||||
|
||||
const resolutionTable = await RdDResolutionTable.buildHTMLTable(RdDResolutionTable.subTable(rollData.caracValue, rollData.finalLevel))
|
||||
const adjustements = await this.buildAjustements(rollData);
|
||||
|
||||
|
||||
HtmlUtility.showControlWhen(this.html.find(".use-encTotal"), rollData.ajustements.encTotal.visible && RdDCarac.isAgiliteOuDerobee(rollData.selectedCarac));
|
||||
HtmlUtility.showControlWhen(this.html.find(".use-surenc"), rollData.ajustements.surenc.visible && RdDCarac.isActionPhysique(rollData.selectedCarac));
|
||||
HtmlUtility.showControlWhen(this.html.find(".utilisation-moral"), rollData.use.appelAuMoral);
|
||||
HtmlUtility.showControlWhen(this.html.find(".divAppelAuMoral"), rollData.use.appelAuMoral);
|
||||
HtmlUtility.showControlWhen(this.html.find(".diffMoral"), rollData.ajustements.moralTotal.used);
|
||||
// HtmlUtility.showControlWhen(this.html.find(".diffMoral"), rollData.ajustements.moral.used);
|
||||
|
||||
// Mise à jour valeurs
|
||||
this.html.find(".dialog-roll-title").text(this._getTitle(rollData));
|
||||
this.html.find("[name='mortalite']").prop('checked', rollData.mortalite == 'non-mortel');
|
||||
this.html.find(".dmg-arme-actor").text(dmgText);
|
||||
this.html.find("input.check-mortalite").prop('checked', rollData.dmg.mortalite == 'non-mortel');
|
||||
this.html.find("label.dmg-arme-actor").text(rollData.dmg.mortalite == 'empoignade'? 'empoignade': Misc.toSignedString(rollData.dmg.total) );
|
||||
this.html.find("label.arme-mortalite").text(rollData.dmg.mortalite);
|
||||
// this.html.find("[name='dmg-arme-actor']").text(rollData.dmg.mortalite == 'empoignade'? 'empoignade': Misc.toSignedString(rollData.dmg.total) );
|
||||
// this.html.find("[name='arme-mortalite']").text(rollData.dmg.mortalite);
|
||||
this.html.find("div.placeholder-ajustements").empty().append(adjustements);
|
||||
this.html.find("div.placeholder-resolution").empty().append(resolutionTable)
|
||||
}
|
||||
@ -336,16 +331,19 @@ export class RdDRoll extends Dialog {
|
||||
return carac;
|
||||
}
|
||||
const compName = rollData.competence.name;
|
||||
if (rollData.draconicList && rollData.selectedSort) {
|
||||
return compName + " - " + rollData.selectedSort.name;
|
||||
}
|
||||
// If a weapon is there, add it in the title
|
||||
const niveau = Misc.toSignedString(rollData.competence.system.niveau)
|
||||
if (compName == carac) {
|
||||
// cas des créatures
|
||||
return carac + " Niveau " + niveau
|
||||
return `${carac} Niveau ${niveau}`
|
||||
}
|
||||
const armeTitle = (rollData.arme) ? " (" + rollData.arme.name + ") " : "";
|
||||
return carac + "/" + compName + armeTitle + " Niveau " + niveau
|
||||
if (rollData.draconicList && rollData.selectedSort) {
|
||||
// cas de lancer de sort
|
||||
return `${rollData.competence.name} Niveau ${niveau} ${rollData.selectedSort.name}`
|
||||
}
|
||||
if (rollData.arme && rollData.arme.name != compName) {
|
||||
// ajouter l'arme au titre si son nom n'est pas la compétence
|
||||
return `${carac} / ${compName} (${rollData.arme.name}) Niveau ${niveau}`
|
||||
}
|
||||
return `${carac} / ${compName} Niveau ${niveau}`
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ import { RdDDice } from "./rdd-dice.js";
|
||||
import { STATUSES } from "./settings/status-effects.js";
|
||||
import { RdDRencontre } from "./item/rencontre.js";
|
||||
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
||||
import { TYPES } from "./item.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
@ -56,14 +57,14 @@ export class RdDTMRDialog extends Dialog {
|
||||
this.actor = actor;
|
||||
this.actor.tmrApp = this; // reference this app in the actor structure
|
||||
this.viewOnly = tmrData.mode == "visu"
|
||||
this.fatigueParCase = this.viewOnly || !ReglesOptionnelles.isUsing("appliquer-fatigue") ? 0 : this.actor.getTMRFatigue();
|
||||
this.fatigueParCase = this.viewOnly ? 0 : this.actor.getCoutFatigueTMR();
|
||||
this.cumulFatigue = 0;
|
||||
this.loadRencontres();
|
||||
this.loadCasesSpeciales();
|
||||
this.allTokens = [];
|
||||
this.rencontreState = 'aucune';
|
||||
this.pixiApp = new PIXI.Application({ width: 720, height: 860 });
|
||||
this.pixiTMR = new PixiTMR(this, this.pixiApp);
|
||||
this.pixiTMR = new PixiTMR(this);
|
||||
|
||||
this.subdialog = undefined
|
||||
|
||||
this.callbacksOnAnimate = [];
|
||||
@ -83,6 +84,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
}
|
||||
async restoreTMRAfterAction() {
|
||||
this.subdialog = undefined
|
||||
await this.maximize();
|
||||
this.bringToTop();
|
||||
}
|
||||
|
||||
@ -109,11 +111,11 @@ export class RdDTMRDialog extends Dialog {
|
||||
}
|
||||
|
||||
get sortsReserve() {
|
||||
return this.actor.itemTypes['sortreserve'];
|
||||
return this.actor.itemTypes[TYPES.sortreserve];
|
||||
}
|
||||
|
||||
getSortsReserve(coord) {
|
||||
return this.actor.itemTypes['sortreserve'].filter(// Reserve sur une case fleuve ou normale
|
||||
return this.actor.itemTypes[TYPES.sortreserve].filter(// Reserve sur une case fleuve ou normale
|
||||
TMRUtility.getTMR(coord).type == 'fleuve'
|
||||
? it => TMRUtility.getTMR(it.system.coord).type == 'fleuve'
|
||||
: it => it.system.coord == coord
|
||||
@ -127,7 +129,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
createPixiSprites() {
|
||||
EffetsDraconiques.carteTmr.createSprite(this.pixiTMR);
|
||||
this.pixiTMR.setup()
|
||||
this.updateTokens();
|
||||
this.forceDemiRevePositionView();
|
||||
}
|
||||
@ -138,13 +140,9 @@ export class RdDTMRDialog extends Dialog {
|
||||
this.demiReve = this._tokenDemiReve();
|
||||
this._trackToken(this.demiReve);
|
||||
}
|
||||
let tokens = this._getTokensCasesTmr()
|
||||
.concat(this._getTokensRencontres())
|
||||
.concat(this._getTokensSortsReserve());
|
||||
|
||||
for (let t of tokens) {
|
||||
this._trackToken(t);
|
||||
}
|
||||
this._getTokensCasesTmr().forEach(t => this._trackToken(t))
|
||||
this._getTokensRencontres().forEach(t => this._trackToken(t))
|
||||
this._getTokensSortsReserve().forEach(t => this._trackToken(t))
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -169,7 +167,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
return this.rencontresExistantes.map(it => this._tokenRencontre(it));
|
||||
}
|
||||
_getTokensSortsReserve() {
|
||||
return this.actor.itemTypes['sortreserve'].map(it => this._tokenSortEnReserve(it));
|
||||
return this.actor.itemTypes[TYPES.sortreserve].map(it => this._tokenSortEnReserve(it));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -203,6 +201,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
if (this.subdialog) {
|
||||
return this.forceTMRContinueAction();
|
||||
}
|
||||
|
||||
let oddq = TMRUtility.coordTMRToOddq(this._getActorCoord());
|
||||
|
||||
if (move == 'top') oddq.row -= 1;
|
||||
@ -229,7 +228,8 @@ export class RdDTMRDialog extends Dialog {
|
||||
|
||||
document.getElementsByClassName("tmr-row")
|
||||
.item(0)
|
||||
.insertCell(0).append(this.pixiApp.view);
|
||||
.insertCell(0)
|
||||
.append(this.pixiTMR.view);
|
||||
|
||||
if (this.viewOnly) {
|
||||
this.html.find('.lancer-sort').remove();
|
||||
@ -240,31 +240,22 @@ export class RdDTMRDialog extends Dialog {
|
||||
HtmlUtility.showControlWhen(this.html.find(".appliquerFatigue"), ReglesOptionnelles.isUsing("appliquer-fatigue"));
|
||||
HtmlUtility.showControlWhen(this.html.find(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(this._getActorCoord()));
|
||||
|
||||
this.html.find('tr.tmr-row *').click((event) => {
|
||||
this.subdialog?.bringToTop();
|
||||
});
|
||||
this.html.find('tr.tmr-row *').click(event => this.subdialog?.bringToTop());
|
||||
|
||||
// Roll Sort
|
||||
this.html.find('.lancer-sort').click((event) => {
|
||||
this.actor.rollUnSort(this._getActorCoord());
|
||||
});
|
||||
this.html.find('.lire-signe-draconique').click((event) => {
|
||||
this.actor.rollLireSigneDraconique(this._getActorCoord());
|
||||
});
|
||||
|
||||
this.html.find('#dir-top').click((event) => this.moveFromKey("top"));
|
||||
this.html.find('#dir-top-left').click((event) => this.moveFromKey("top-left"));
|
||||
this.html.find('#dir-top-right').click((event) => this.moveFromKey("top-right"));
|
||||
this.html.find('#dir-bottom-left').click((event) => this.moveFromKey("bottom-left"));
|
||||
this.html.find('#dir-bottom-right').click((event) => this.moveFromKey("bottom-right"));
|
||||
this.html.find('#dir-bottom').click((event) => this.moveFromKey("bottom"));
|
||||
this.html.find('.lancer-sort').click(event => this.actor.rollUnSort(this._getActorCoord()));
|
||||
this.html.find('.lire-signe-draconique').click(event => this.actor.rollLireSigneDraconique(this._getActorCoord()));
|
||||
this.html.find('#dir-top').click(event=> this.moveFromKey("top"));
|
||||
this.html.find('#dir-top-left').click(event=> this.moveFromKey("top-left"));
|
||||
this.html.find('#dir-top-right').click(event=> this.moveFromKey("top-right"));
|
||||
this.html.find('#dir-bottom-left').click(event=> this.moveFromKey("bottom-left"));
|
||||
this.html.find('#dir-bottom-right').click(event=> this.moveFromKey("bottom-right"));
|
||||
this.html.find('#dir-bottom').click(event=> this.moveFromKey("bottom"));
|
||||
|
||||
// Gestion du cout de montée en points de rêve
|
||||
let reveCout = ((this.tmrdata.isRapide && !EffetsDraconiques.isDeplacementAccelere(this.actor)) ? -2 : -1) - this.actor.countMonteeLaborieuse();
|
||||
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
||||
this.cumulFatigue += this.fatigueParCase;
|
||||
}
|
||||
await this.actor.reveActuelIncDec(reveCout);
|
||||
this.cumulFatigue += this.fatigueParCase;
|
||||
// Le reste...
|
||||
this.updateValuesDisplay();
|
||||
let tmr = TMRUtility.getTMR(this._getActorCoord());
|
||||
@ -315,7 +306,8 @@ export class RdDTMRDialog extends Dialog {
|
||||
await this.actor.setEffect(STATUSES.StatusDemiReve, false)
|
||||
this._tellToGM(this.actor.name + " a quitté les terres médianes");
|
||||
}
|
||||
await this.actor.santeIncDec("fatigue", this.cumulFatigue)
|
||||
await this.actor.santeIncDec((ReglesOptionnelles.isUsing("appliquer-fatigue") ? "fatigue" : "endurance"),
|
||||
this.cumulFatigue)
|
||||
}
|
||||
await super.close();
|
||||
}
|
||||
@ -382,19 +374,8 @@ export class RdDTMRDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
$marquerCasesTMR(listCoordTMR) {
|
||||
this.currentRencontre.graphics = []; // Keep track of rectangles to delete it
|
||||
this.currentRencontre.locList = duplicate(listCoordTMR); // And track of allowed location
|
||||
for (let coordTMR of listCoordTMR) {
|
||||
const rect = this._getCaseRectangleCoord(coordTMR);
|
||||
const rectDraw = new PIXI.Graphics();
|
||||
rectDraw.beginFill(0xffff00, 0.3);
|
||||
// set the line style to have a width of 5 and set the color to red
|
||||
rectDraw.lineStyle(5, 0xff0000);
|
||||
// draw a rectangle
|
||||
rectDraw.drawRect(rect.x, rect.y, rect.w, rect.h);
|
||||
this.pixiApp.stage.addChild(rectDraw);
|
||||
this.currentRencontre.graphics.push(rectDraw); // garder les objets pour gestion post-click
|
||||
}
|
||||
this.currentRencontre.graphics = listCoordTMR.map(coordTMR => this.pixiTMR.addMarkTMR(coordTMR))
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -404,12 +385,16 @@ export class RdDTMRDialog extends Dialog {
|
||||
this.close();
|
||||
return true;
|
||||
}
|
||||
const resteAvantInconscience = this.actor.getFatigueMax() - this.actor.getFatigueActuelle() - this.cumulFatigue;
|
||||
if (ReglesOptionnelles.isUsing("appliquer-fatigue") && resteAvantInconscience <= 0) {
|
||||
|
||||
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();
|
||||
@ -903,15 +888,11 @@ export class RdDTMRDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
nettoyerRencontre() {
|
||||
if (!this.currentRencontre) return; // Sanity check
|
||||
if (this.currentRencontre.graphics) {
|
||||
for (let drawRect of this.currentRencontre.graphics) {
|
||||
// Suppression des dessins des zones possibles
|
||||
this.pixiApp.stage.removeChild(drawRect);
|
||||
}
|
||||
}
|
||||
this.currentRencontre = undefined; // Nettoyage de la structure
|
||||
this.rencontreState = 'aucune'; // Et de l'état
|
||||
// Suppression des dessins des zones possibles
|
||||
this.currentRencontre?.graphics?.forEach(graphic => this.pixiTMR.removeGraphic(graphic))
|
||||
// Nettoyage de la structureet de l'état
|
||||
this.currentRencontre = undefined;
|
||||
this.rencontreState = 'aucune';
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1102,18 +1083,10 @@ export class RdDTMRDialog extends Dialog {
|
||||
await this.postRencontre(tmr);
|
||||
return tmr;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
/** Retourne les coordonnées x, h, w, h du rectangle d'une case donnée */
|
||||
_getCaseRectangleCoord(coord) {
|
||||
return this.pixiTMR.getCaseRectangle(TMRUtility.coordTMRToOddq(coord));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_removeTokens(filter) {
|
||||
const tokensToRemove = this.allTokens.filter(filter);
|
||||
for (let token of tokensToRemove) {
|
||||
this.pixiApp.stage.removeChild(token.sprite);
|
||||
}
|
||||
this.allTokens.filter(filter).forEach(token => this.pixiTMR.removeToken(token))
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1121,7 +1094,9 @@ export class RdDTMRDialog extends Dialog {
|
||||
if (this.demiReve === token && this.isDemiReveCache()) {
|
||||
return;
|
||||
}
|
||||
this.pixiTMR.setPosition(token.sprite, TMRUtility.coordTMRToOddq(token.coordTMR()));
|
||||
this.allTokens.push(token);
|
||||
this.pixiTMR.positionToken(token);
|
||||
if (!this.allTokens.includes(token)) {
|
||||
this.allTokens.push(token);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ export class RdDTMRRencontreDialog extends Dialog {
|
||||
}
|
||||
else {
|
||||
ui.notifications.info("Vous devez résoudre la rencontre.");
|
||||
this.actor.tmrApp.forceTMRContinueAction();
|
||||
return this.actor.tmrApp.forceTMRContinueAction();
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -28,7 +28,7 @@ const ajustementsEncaissement = Misc.intArray(-10, 26);
|
||||
/* -------------------------------------------- */
|
||||
function _buildAllSegmentsFatigue(max) {
|
||||
const cycle = [5, 2, 4, 1, 3, 0];
|
||||
let fatigue = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
|
||||
const fatigue = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
|
||||
for (let i = 0; i <= max; i++) {
|
||||
const ligneFatigue = duplicate(fatigue[i]);
|
||||
const caseIncrementee = cycle[i % 6];
|
||||
@ -55,7 +55,8 @@ function _cumulSegmentsFatigue(matrix) {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
const fatigueMatrix = _buildAllSegmentsFatigue(60);
|
||||
export const MAX_ENDURANCE_FATIGUE = 60;
|
||||
const fatigueMatrix = _buildAllSegmentsFatigue(MAX_ENDURANCE_FATIGUE);
|
||||
const cumulFatigueMatrix = _cumulSegmentsFatigue(fatigueMatrix);
|
||||
|
||||
const fatigueMalus = [0, 0, 0, -1, -1, -1, -2, -3, -4, -5, -6, -7]; // Provides the malus for each segment of fatigue
|
||||
@ -245,7 +246,8 @@ export class RdDUtility {
|
||||
'systems/foundryvtt-reve-de-dragon/templates/chat-description.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/chat-info-distance.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/chat-actor-turn-summary.html',
|
||||
'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-competence-xp.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/chat-actor-carac-xp.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/chat-potionenchantee-chateaudormant.html',
|
||||
@ -287,7 +289,8 @@ export class RdDUtility {
|
||||
Handlebars.registerHelper('uniteQuantite', (itemId, actorId) => RdDUtility.getItem(itemId, actorId)?.getUniteQuantite());
|
||||
Handlebars.registerHelper('isFieldInventaireModifiable', (type, field) => RdDItem.isFieldInventaireModifiable(type, field));
|
||||
Handlebars.registerHelper('rarete-getChamp', (rarete, field) => RdDRaretes.getChamp(rarete, field));
|
||||
|
||||
|
||||
Handlebars.registerHelper('plusMoins', diff => (diff > 0 ? '+' : '') + Math.round(diff))
|
||||
Handlebars.registerHelper('experienceLog-topic', topic => ExperienceLog.labelTopic(topic));
|
||||
|
||||
return loadTemplates(templatePaths);
|
||||
@ -459,18 +462,15 @@ export class RdDUtility {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getSegmentsFatigue(maxEnd) {
|
||||
maxEnd = Math.max(maxEnd, 1);
|
||||
maxEnd = Math.min(maxEnd, fatigueMatrix.length);
|
||||
return fatigueMatrix[maxEnd];
|
||||
static getSegmentsFatigue(maxEndurance) {
|
||||
return fatigueMatrix[Math.min(Math.max(maxEndurance, 1), fatigueMatrix.length)];
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static calculMalusFatigue(fatigue, maxEnd) {
|
||||
maxEnd = Math.max(maxEnd, 1);
|
||||
maxEnd = Math.min(maxEnd, cumulFatigueMatrix.length);
|
||||
let segments = cumulFatigueMatrix[maxEnd];
|
||||
for (let i = 0; i < 12; i++) {
|
||||
static calculMalusFatigue(fatigue, endurance) {
|
||||
endurance = Math.min(Math.max(endurance, 1), cumulFatigueMatrix.length);
|
||||
let segments = cumulFatigueMatrix[endurance];
|
||||
for (let i = 0; i < segments.length; i++) {
|
||||
if (fatigue <= segments[i]) {
|
||||
return fatigueMalus[i]
|
||||
}
|
||||
@ -490,7 +490,7 @@ export class RdDUtility {
|
||||
// Build the nice (?) html table used to manage fatigue.
|
||||
// max should be the endurance max value
|
||||
static makeHTMLfatigueMatrix(fatigue, maxEndurance) {
|
||||
let segments = this.getSegmentsFatigue(maxEndurance);
|
||||
const segments = this.getSegmentsFatigue(maxEndurance);
|
||||
return this.makeHTMLfatigueMatrixForSegment(fatigue, segments);
|
||||
}
|
||||
|
||||
@ -624,25 +624,6 @@ export class RdDUtility {
|
||||
return perte.total;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static currentFatigueMalus(value, max) {
|
||||
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
||||
max = Math.max(1, Math.min(max, 60));
|
||||
value = Math.min(max * 2, Math.max(0, value));
|
||||
|
||||
let fatigueTab = fatigueMatrix[max];
|
||||
let fatigueRem = value;
|
||||
for (let idx = 0; idx < fatigueTab.length; idx++) {
|
||||
fatigueRem -= fatigueTab[idx];
|
||||
if (fatigueRem <= 0) {
|
||||
return fatigueMalus[idx];
|
||||
}
|
||||
}
|
||||
return -7; // This is the max !
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async responseNombreAstral(callData) {
|
||||
let actor = game.actors.get(callData.id);
|
||||
|
@ -69,8 +69,8 @@ export const referenceAjustements = {
|
||||
getValue: (rollData, actor) => -actor.getEncTotal()
|
||||
},
|
||||
surenc: {
|
||||
isVisible: (rollData, actor) => actor.isSurenc(),
|
||||
isUsed: (rollData, actor) => rollData.use?.surenc,
|
||||
isVisible: (rollData, actor) => RdDCarac.isActionPhysique(rollData.selectedCarac) && actor.isSurenc(),
|
||||
isUsed: (rollData, actor) => rollData.use?.surenc && RdDCarac.isActionPhysique(rollData.selectedCarac),
|
||||
getLabel: (rollData, actor) => 'Sur-encombrement',
|
||||
getValue: (rollData, actor) => actor.computeMalusSurEncombrement()
|
||||
},
|
||||
|
@ -4,6 +4,12 @@ import { Misc } from "../misc.js";
|
||||
const listeReglesOptionnelles = [
|
||||
{ group: 'Règles générales', name: 'appliquer-fatigue', descr: "Appliquer les règles de fatigue"},
|
||||
{ group: 'Règles générales', name: 'astrologie', descr: "Appliquer les ajustements astrologiques aux jets de chance et aux rituels"},
|
||||
{ group: 'Récupération', name: 'transformation-stress', descr: "Transformer le stress durant Château Dormant"},
|
||||
{ group: 'Récupération', name: 'recuperation-chance', descr: "Récupérer la chance durant Château Dormant"},
|
||||
{ group: 'Récupération', name: 'recuperation-ethylisme', descr: "Récupérer l'éthylisme"},
|
||||
{ group: 'Récupération', name: 'recuperation-reve', descr: "Récupérer le rêve pendant la nuit (les jets sont toujours faits pour les Rêves de Dragons)"},
|
||||
{ group: 'Récupération', name: 'recuperation-moral', descr: "Le moral revient vers 0 durant Château Dormant"},
|
||||
|
||||
|
||||
{ group: 'Règles de combat', name: 'recul', descr: "Appliquer le recul en cas de particulière en force ou de charge" },
|
||||
{ group: 'Règles de combat', name: 'resistanceArmeParade', descr: "Faire le jet de résistance des armes lors de parades pouvant les endommager" },
|
||||
|
@ -17,7 +17,7 @@ export class AutoAdjustDarkness {
|
||||
static async adjust(darkness) {
|
||||
if (AutoAdjustDarkness.isAuto()) {
|
||||
const scene = game.scenes.viewed;
|
||||
if (scene.globalLight && scene.tokenVision) {
|
||||
if (scene?.globalLight && scene?.tokenVision) {
|
||||
await scene.update({ darkness });
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { TMRUtility } from "../tmr-utility.js";
|
||||
import { Draconique } from "./draconique.js";
|
||||
import { PixiTMR } from "./pixi-tmr.js";
|
||||
|
||||
@ -16,7 +17,6 @@ export class CarteTmr extends Draconique {
|
||||
img() { return 'systems/foundryvtt-reve-de-dragon/styles/img/ui/tmr.webp' }
|
||||
|
||||
createSprite(pixiTMR) {
|
||||
|
||||
const img = PixiTMR.getImgFromCode(this.code())
|
||||
const sprite = new PIXI.Sprite(PIXI.utils.TextureCache[img]);
|
||||
// Setup the position of the TMR
|
||||
@ -28,10 +28,12 @@ export class CarteTmr extends Draconique {
|
||||
sprite.anchor.set(0);
|
||||
sprite.buttonMode = true;
|
||||
sprite.tmrObject = pixiTMR;
|
||||
|
||||
pixiTMR.addTooltip(sprite, (e,s) => this.computeTooltip(e,s));
|
||||
pixiTMR.pixiApp.stage.addChild(sprite);
|
||||
return sprite;
|
||||
}
|
||||
|
||||
computeTooltip(coordTMR) {
|
||||
const tmr = TMRUtility.getTMR(coordTMR)
|
||||
return tmr? TMRUtility.getTMRLabel(coordTMR) : '';
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -86,15 +86,13 @@ export class Draconique {
|
||||
* @param {*} pixiTMR instance de PixiTMR qui gère les tooltips, les méthodes de création de sprite standard, les clicks.
|
||||
*/
|
||||
token(pixiTMR, linkData, coordTMR, type = undefined) {
|
||||
const tooltip = this.tooltip(linkData);
|
||||
const token = {
|
||||
sprite: this.createSprite(pixiTMR),
|
||||
coordTMR: coordTMR
|
||||
coordTMR: coordTMR,
|
||||
tooltip: tooltip
|
||||
};
|
||||
token[type ?? this.code()] = linkData;
|
||||
this.linkData = linkData;
|
||||
if (this.tooltip(linkData)) {
|
||||
pixiTMR.addTooltip(token.sprite, (e, s) => this.computeTooltip(e, s));
|
||||
}
|
||||
return token;
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ import { ExperienceLog, XP_TOPIC } from "../actor/experience-log.js";
|
||||
import { ChatUtility } from "../chat-utility.js";
|
||||
import { Poetique } from "../poetique.js";
|
||||
import { RdDDice } from "../rdd-dice.js";
|
||||
import { ReglesOptionnelles } from "../settings/regles-optionnelles.js";
|
||||
import { TMRUtility } from "../tmr-utility.js";
|
||||
|
||||
export class EffetsRencontre {
|
||||
@ -9,7 +10,7 @@ export class EffetsRencontre {
|
||||
static messager = async (dialog, context) => {
|
||||
dialog.setRencontreState('messager', TMRUtility.getTMRPortee(context.tmr.coord, context.rencontre.system.force));
|
||||
}
|
||||
|
||||
|
||||
static passeur = async (dialog, context) => {
|
||||
dialog.setRencontreState('passeur', TMRUtility.getTMRPortee(context.tmr.coord, context.rencontre.system.force));
|
||||
}
|
||||
@ -26,16 +27,25 @@ export class EffetsRencontre {
|
||||
static reve_plus_1 = async (dialog, context) => { await EffetsRencontre.$reve_plus(context.actor, 1) }
|
||||
static reve_moins_force = async (dialog, context) => { await EffetsRencontre.$reve_plus(context.actor, -context.rencontre.system.force) }
|
||||
static reve_moins_1 = async (dialog, context) => { await EffetsRencontre.$reve_plus(context.actor, -1) }
|
||||
static $reve_plus = async (actor, valeur) => { await actor.reveActuelIncDec(valeur) }
|
||||
static $reve_plus = async (actor, reve) => {
|
||||
if (!ReglesOptionnelles.isUsing("recuperation-reve") && reve < 0) {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(actor.name),
|
||||
content: `Pas de récupération de rêve (${reve} points ignorés)`
|
||||
});
|
||||
return
|
||||
}
|
||||
await actor.reveActuelIncDec(reve)
|
||||
}
|
||||
|
||||
static vie_moins_1 = async (dialog, context) => { await EffetsRencontre.$vie_plus(context.actor, -1) }
|
||||
static vie_moins_force = async (dialog, context) => { await EffetsRencontre.$vie_plus(context.actor, -context.rencontre.system.force) }
|
||||
static $vie_plus = async (actor, valeur) => { await actor.santeIncDec("vie", valeur) }
|
||||
|
||||
|
||||
static moral_plus_1 = async (dialog, context) => { await EffetsRencontre.$vie_plus(context.actor, 1) }
|
||||
static moral_moins_1 = async (dialog, context) => { await EffetsRencontre.$vie_plus(context.actor, -1) }
|
||||
static $moral_plus = async (actor, valeur) => { await actor.moralIncDec(valeur) }
|
||||
|
||||
|
||||
static end_moins_1 = async (dialog, context) => { await EffetsRencontre.$vie_plus(context.actor, -1) }
|
||||
static end_moins_force = async (dialog, context) => { await EffetsRencontre.$vie_plus(context.actor, -context.rencontre.system.force) }
|
||||
static $end_plus = async (actor, valeur) => { await actor.santeIncDec("endurance", valeur) }
|
||||
@ -50,8 +60,8 @@ export class EffetsRencontre {
|
||||
const perte = context.rolled.isETotal ? context.rencontre.system.force : 1;
|
||||
await context.actor.chanceActuelleIncDec("fatigue", -perte);
|
||||
}
|
||||
|
||||
static xp_sort_force = async (dialog, context) => {
|
||||
|
||||
static xp_sort_force = async (dialog, context) => {
|
||||
let competence = context.competence;
|
||||
if (competence) {
|
||||
const fromXpSort = Number(competence.system.xp_sort);
|
||||
@ -60,7 +70,7 @@ export class EffetsRencontre {
|
||||
await ExperienceLog.add(this, XP_TOPIC.XPSORT, fromXpSort, toXpSort, `${competence.name} - ${context.rencontre.name} en TMR`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static stress_plus_1 = async (dialog, context) => {
|
||||
await context.actor.addCompteurValue('stress', 1, `Rencontre d'un ${context.rencontre.name} en TMR`);
|
||||
}
|
||||
@ -75,7 +85,7 @@ export class EffetsRencontre {
|
||||
|
||||
static demireve_rompu = async (dialog, context) => {
|
||||
dialog.close()
|
||||
}
|
||||
}
|
||||
|
||||
static sort_aleatoire = async (dialog, context) => {
|
||||
context.sortReserve = await RdDDice.rollOneOf(context.actor.itemTypes['sortreserve']);
|
||||
@ -128,7 +138,7 @@ export class EffetsRencontre {
|
||||
|
||||
static regain_seuil = async (dialog, context) => {
|
||||
await context.actor.regainPointDeSeuil()
|
||||
}
|
||||
}
|
||||
|
||||
static async $reinsertion(dialog, actor, filter) {
|
||||
const newTMR = await TMRUtility.getTMRAleatoire(filter);
|
||||
|
@ -1,6 +1,8 @@
|
||||
import { Misc } from "../misc.js";
|
||||
import { RdDTMRDialog } from "../rdd-tmr-dialog.js";
|
||||
import { tmrConstants, tmrTokenZIndex } from "../tmr-constants.js";
|
||||
import { TMRUtility } from "../tmr-utility.js";
|
||||
import { EffetsDraconiques } from "./effets-draconiques.js";
|
||||
|
||||
export const tooltipStyle = new PIXI.TextStyle({
|
||||
fontFamily: 'CaslonAntique',
|
||||
@ -15,11 +17,35 @@ export class PixiTMR {
|
||||
|
||||
static textures = []
|
||||
|
||||
constructor(tmrObject, pixiApp) {
|
||||
this.tmrObject = tmrObject;
|
||||
this.pixiApp = pixiApp ?? tmrObject.pixiApp;
|
||||
this.pixiApp.stage.sortableChildren = true;
|
||||
constructor(tmrDialog) {
|
||||
this.tmrDialog = tmrDialog;
|
||||
|
||||
this.callbacksOnAnimate = [];
|
||||
|
||||
this.pixiApp = new PIXI.Application({ width: 720, height: 860 });
|
||||
this.pixiApp.eventMode = 'static';
|
||||
this.pixiApp.stage.sortableChildren = true;
|
||||
this.tooltip = new PIXI.Text('', tooltipStyle);
|
||||
this.tooltip.zIndex = 1000
|
||||
|
||||
this.pixiApp.stage.addChild(this.tooltip);
|
||||
|
||||
}
|
||||
|
||||
get view() {
|
||||
return this.pixiApp.view
|
||||
}
|
||||
|
||||
setup() {
|
||||
this.carteTMR = EffetsDraconiques.carteTmr.createSprite(this);
|
||||
this.pixiApp.stage.addChild(this.carteTMR);
|
||||
this.carteTMR.isOver = false;
|
||||
this.carteTMR.eventMode = 'static';
|
||||
this.carteTMR
|
||||
.on('pointermove', event => this.onPointerMove(event))
|
||||
.on('pointerdown', event => this.onClickBackground(event))
|
||||
.on('pointerover', event => this.onShowTooltip(event))
|
||||
.on('pointerout', event => this.onHideTooltip(event));
|
||||
}
|
||||
|
||||
async load(onLoad = (loader, resources) => { }) {
|
||||
@ -46,6 +72,22 @@ export class PixiTMR {
|
||||
this.callbacksOnAnimate.push(() => animation(this.pixiApp));
|
||||
}
|
||||
|
||||
addMarkTMR(coordTMR) {
|
||||
const rect = this.getCaseRectangle(TMRUtility.coordTMRToOddq(coordTMR))
|
||||
const markTMR = new PIXI.Graphics();
|
||||
markTMR.beginFill(0xffff00, 0.3);
|
||||
// set the line style to have a width of 5 and set the color to red
|
||||
markTMR.lineStyle(5, 0xff0000);
|
||||
// draw a rectangle
|
||||
markTMR.drawRect(rect.x, rect.y, rect.w, rect.h);
|
||||
this.pixiApp.stage.addChild(markTMR);
|
||||
return markTMR
|
||||
}
|
||||
|
||||
removeGraphic(graphic) {
|
||||
this.pixiApp.stage.removeChild(graphic);
|
||||
}
|
||||
|
||||
sprite(code, options = {}) {
|
||||
let img = PixiTMR.getImgFromCode(code)
|
||||
const texture = PIXI.utils.TextureCache[img];
|
||||
@ -67,7 +109,7 @@ export class PixiTMR {
|
||||
return sprite;
|
||||
}
|
||||
|
||||
circle(name, options = {}) {
|
||||
circle(code, options = {}) {
|
||||
let sprite = new PIXI.Graphics();
|
||||
sprite.beginFill(options.color, options.opacity);
|
||||
sprite.drawCircle(0, 0, (options.taille ?? 12) / 2);
|
||||
@ -77,63 +119,76 @@ export class PixiTMR {
|
||||
return sprite;
|
||||
}
|
||||
|
||||
addTooltip(sprite, computeTooltip) {
|
||||
sprite.tooltip = new PIXI.Text('', tooltipStyle);
|
||||
sprite.tooltip.zIndex = tmrTokenZIndex.tooltip;
|
||||
sprite.isOver = false;
|
||||
sprite.eventMode = 'dynamic'; // PIXI 7 To be checked
|
||||
sprite
|
||||
.on('pointermove', event => this.onPointerMove(event, sprite, computeTooltip))
|
||||
.on('pointerdown', event => this.onClickBackground(event))
|
||||
.on('pointerover', event => this.onShowTooltip(event, sprite))
|
||||
.on('pointerout', event => this.onHideTooltip(event, sprite));
|
||||
}
|
||||
|
||||
onClickBackground(event) {
|
||||
if (!this.viewOnly) {
|
||||
this.tmrObject.onClickTMR(event)
|
||||
this.tmrDialog.onClickTMR(event)
|
||||
}
|
||||
}
|
||||
|
||||
onPointerMove(event, sprite, computeTooltip) {
|
||||
if (sprite.isOver && sprite.tooltip) {
|
||||
var { x, y } = TMRUtility.computeEventPosition(event);
|
||||
const oddq = TMRUtility.computeOddq(x, y);
|
||||
onPointerMove(event) {
|
||||
if (this.carteTMR.isOver) {
|
||||
this.setTooltipPosition(event);
|
||||
this.tooltip.text = this.computeTooltip(event);
|
||||
}
|
||||
}
|
||||
|
||||
onShowTooltip(event) {
|
||||
if (!this.carteTMR.isOver) {
|
||||
this.setTooltipPosition(event);
|
||||
this.pixiApp.stage.addChild(this.tooltip);
|
||||
this.tooltip.text = this.computeTooltip(event);
|
||||
}
|
||||
this.carteTMR.isOver = true;
|
||||
}
|
||||
|
||||
sprite.tooltip.x = x + (oddq.col > 8 ? - 3 * tmrConstants.full : tmrConstants.half)
|
||||
sprite.tooltip.y = y + (oddq.row > 10 ? - tmrConstants.half : tmrConstants.half)
|
||||
sprite.tooltip.text = computeTooltip(event, sprite);
|
||||
onHideTooltip(event) {
|
||||
if (this.carteTMR.isOver) {
|
||||
this.pixiApp.stage.removeChild(this.tooltip);
|
||||
}
|
||||
this.carteTMR.isOver = false;
|
||||
}
|
||||
|
||||
computeTooltip(event) {
|
||||
const oddq = TMRUtility.computeEventOddq(event);
|
||||
const coordTMR = TMRUtility.oddqToCoordTMR(oddq);
|
||||
const tmr = TMRUtility.getTMR(coordTMR)
|
||||
if (tmr) {
|
||||
const labelTMR = TMRUtility.getTMRLabel(coordTMR);
|
||||
const tokenTooltips = this.tmrDialog.allTokens
|
||||
.filter(token => token.coordTMR() == coordTMR)
|
||||
.map(token => token.tooltip);
|
||||
const tmrTooltip = `${coordTMR}: ${labelTMR}`;
|
||||
return [tmrTooltip, ...tokenTooltips].reduce(Misc.joining('\n'))
|
||||
}
|
||||
}
|
||||
|
||||
onShowTooltip(event, sprite) {
|
||||
if (sprite.tooltip) {
|
||||
if (!sprite.isOver) {
|
||||
sprite.tooltip.x = sprite.x;
|
||||
sprite.tooltip.y = sprite.y;
|
||||
this.pixiApp.stage.addChild(sprite.tooltip);
|
||||
}
|
||||
sprite.isOver = true;
|
||||
setTooltipPosition(event) {
|
||||
var { x, y } = TMRUtility.computeEventPosition(event);
|
||||
const oddq = TMRUtility.computeOddq(x, y);
|
||||
|
||||
this.tooltip.x = x + (oddq.col > 8 ? -3 * tmrConstants.full : tmrConstants.half);
|
||||
this.tooltip.y = y + (oddq.row > 10 ? -tmrConstants.half : tmrConstants.half);
|
||||
}
|
||||
|
||||
positionToken(token) {
|
||||
if (token.sprite) {
|
||||
const sprite = token.sprite;
|
||||
const oddq = TMRUtility.coordTMRToOddq(token.coordTMR());
|
||||
|
||||
const decallagePairImpair = (oddq.col % 2 == 0) ? tmrConstants.col1_y : tmrConstants.col2_y;
|
||||
const dx = (sprite.decallage == undefined) ? 0 : sprite.decallage.x;
|
||||
const dy = (sprite.decallage == undefined) ? 0 : sprite.decallage.y;
|
||||
sprite.x = tmrConstants.gridx + (oddq.col * tmrConstants.cellw) + dx;
|
||||
sprite.y = tmrConstants.gridy + (oddq.row * tmrConstants.cellh) + dy + decallagePairImpair;
|
||||
}
|
||||
}
|
||||
|
||||
onHideTooltip(event, sprite) {
|
||||
if (sprite.tooltip) {
|
||||
if (sprite.isOver) {
|
||||
this.pixiApp.stage.removeChild(sprite.tooltip);
|
||||
}
|
||||
sprite.isOver = false;
|
||||
removeToken(token) {
|
||||
if (token.sprite) {
|
||||
this.pixiApp.stage.removeChild(token.sprite)
|
||||
}
|
||||
}
|
||||
|
||||
setPosition(sprite, oddq) {
|
||||
let decallagePairImpair = (oddq.col % 2 == 0) ? tmrConstants.col1_y : tmrConstants.col2_y;
|
||||
let dx = (sprite.decallage == undefined) ? 0 : sprite.decallage.x;
|
||||
let dy = (sprite.decallage == undefined) ? 0 : sprite.decallage.y;
|
||||
sprite.x = tmrConstants.gridx + (oddq.col * tmrConstants.cellw) + dx;
|
||||
sprite.y = tmrConstants.gridy + (oddq.row * tmrConstants.cellh) + dy + decallagePairImpair;
|
||||
}
|
||||
|
||||
getCaseRectangle(oddq) {
|
||||
let decallagePairImpair = (oddq.col % 2 == 0) ? tmrConstants.col1_y : tmrConstants.col2_y;
|
||||
let x = tmrConstants.gridx + (oddq.col * tmrConstants.cellw) - (tmrConstants.cellw / 2);
|
||||
|
@ -13,8 +13,8 @@ export class ReserveExtensible extends Draconique {
|
||||
manualMessage() { return "Vous pouvez re-configurer votre Réserve extensible" }
|
||||
async onActorCreateOwned(actor, tete) {
|
||||
const existants = actor.items.filter(it => this.isCase(it)).map(it => it.system.coord);
|
||||
const tmr = await TMRUtility.getTMRAleatoire(it => !(it.type == 'fleuve' || existants.includes(it.system.coord)));
|
||||
await this.createCaseTmr(actor, "Nouvelle Réserve extensible", tmr, tete.id);
|
||||
const selectedTMR = await TMRUtility.getTMRAleatoire(tmr => !(tmr.type == 'fleuve' || existants.includes(tmr.coord)));
|
||||
await this.createCaseTmr(actor, "Nouvelle Réserve extensible", selectedTMR, tete.id);
|
||||
}
|
||||
|
||||
code() { return 'reserve_extensible' }
|
||||
|
@ -14,8 +14,8 @@ export class TrouNoir extends Draconique {
|
||||
|
||||
async onActorCreateOwned(actor, souffle) {
|
||||
const existants = actor.items.filter(it => this.isCase(it)).map(it => it.system.coord);
|
||||
const tmr = await TMRUtility.getTMRAleatoire(it => !(TMRUtility.isCaseHumide(it) || existants.includes(it.system.coord)));
|
||||
await this.createCaseTmr(actor, 'Trou noir: ' + tmr.label, tmr, souffle.id);
|
||||
const selectedTMR = await TMRUtility.getTMRAleatoire(tmr => !(TMRUtility.isCaseHumide(tmr) || existants.includes(tmr.coord)));
|
||||
await this.createCaseTmr(actor, 'Trou noir: ' + selectedTMR.label, selectedTMR, souffle.id);
|
||||
}
|
||||
|
||||
code() { return 'trounoir' }
|
||||
|
@ -8,15 +8,11 @@ import { Draconique } from "./draconique.js";
|
||||
|
||||
export class UrgenceDraconique extends Draconique {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
type() { return 'queue' }
|
||||
match(item) { return Draconique.isQueueDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes('urgence draconique'); }
|
||||
manualMessage() { return false }
|
||||
async onActorCreateOwned(actor, queue) {
|
||||
const coordSortsReserve = (actor.system.reve.reserve?.list.map(it => it.coord)) ?? [];
|
||||
const coordSortsReserve = actor.itemTypes[TYPES.sortreserve].map(it => it.system.coord) ?? [];
|
||||
if (coordSortsReserve.length == 0) {
|
||||
// La queue se transforme en idée fixe
|
||||
const ideeFixe = await RdDRollTables.getIdeeFixe();
|
||||
@ -26,7 +22,6 @@ export class UrgenceDraconique extends Draconique {
|
||||
});
|
||||
await actor.createEmbeddedDocuments('Item', [ideeFixe]);
|
||||
await actor.deleteEmbeddedDocuments('Item', [queue.id]);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
const demiReve = actor.getDemiReve();
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,13 +1,14 @@
|
||||
{"name":"Jet de moral","type":"script","author":"Hp9ImM4o9YRTSdfu","img":"icons/magic/control/mouth-smile-deception-purple.webp","scope":"global","command":"const selected = game.system.rdd.RdDUtility.getSelectedActor();\nif (!selected) {\n ui.notifications.info('Pas de personnage sélectionné');\n return;\n}\n\nconst dialogMoral = new Dialog({\n title: `Jet de moral`,\n content: `Jet de moral en situation`,\n buttons: {\n malheureuse: { label: `malheureuse`, icon: \"<i class='fa-regular fa-face-frown'></i>\", callback: () => selected.jetDeMoral('malheureuse') },\n neutre: { label: `neutre`, icon: \"<i class='fa-regular fa-face-meh'></i>\", callback: () => selected.jetDeMoral('neutre') },\n heureuse: { label: `heureuse`, icon: \"<i class='fa-regular fa-face-smile'></i>\", callback: () => selected.jetDeMoral('heureuse') }\n },\n});\n\ndialogMoral.render(true)","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.aJ0QGnXAXT0WiXbk"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.15","coreVersion":"10.291","createdTime":1671235038906,"modifiedTime":1671236054480,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"2VvH2rmxV33jGjMU"}
|
||||
{"name":"Repos","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/svg/sleep.svg","command":"const selected = game.system.rdd.RdDUtility.getSelectedActor();\nif (selected) {\n selected.repos();\n}\nelse {\n ui.notifications.info('Pas de personnage sélectionné');\n}","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.XHNbjnGKXaCiCadq"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.15","coreVersion":"10.291","createdTime":1671220038331,"modifiedTime":1671234271278,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"6LRZ8DOVfqotIEsi"}
|
||||
{"name":"Météo marine","type":"chat","author":"Hp9ImM4o9YRTSdfu","img":"icons/magic/air/wind-weather-sailing-ship.webp","scope":"global","command":"/meteo","flags":{"core":{"sourceId":"Macro.EPhCYk7PFMPlIFhS"}},"ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.15","coreVersion":"10.291","createdTime":1671237060687,"modifiedTime":1671237060687,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"9mYZfKoi4ZYHydxa"}
|
||||
{"name":"Chuchoter aux joueurs","type":"script","author":"Hp9ImM4o9YRTSdfu","img":"icons/svg/deaf.svg","scope":"global","command":"/** \n * Provides a dialog to whisper specific players. If you have tokens selected, it will automatically default to try and whisper those players.\n * @Author: Nelson#3570\n */\n\nlet applyChanges = false;\n\nlet users = game.users.filter(user => user.active);\nlet checkOptions = \"\"\nlet playerTokenIds = users.map(u => u.character?.id).filter(id => id !== undefined);\nlet selectedPlayerIds = canvas.tokens.controlled.map(token => {\n if (playerTokenIds.includes(token.actor.id)) return token.actor.id;\n});\n\n// Build checkbox list for all active players\nusers.forEach(user => {\n let checked = !!user.character && selectedPlayerIds.includes(user.character.id) && 'checked';\n checkOptions+=`\n <br>\n <input type=\"checkbox\" name=\"${user.id}\" id=\"${user.id}\" value=\"${user.name}\" ${checked}>\\n\n <label for=\"${user.id}\">${user.name}</label>\n `\n});\n\nnew Dialog({\n title:\"Whisper\",\n content:`Whisper To: ${checkOptions} <br>\n <label for=\"message\">Message:</label>\n <textarea id=\"message\" name=\"message\" rows=\"4\" cols=\"50\"></textarea><br>`,\n buttons:{\n whisper:{ \n label:\"Whisper\",\n callback: (html) => createMessage(html)\n }\n }\n}).render(true);\n\nfunction createMessage(html) {\n var targets = [];\n // build list of selected players ids for whispers target\n for ( let user of users ) {\n if (html.find('[name=\"'+user.id+'\"]')[0].checked){\n applyChanges=true;\n targets.push(user.id);\n }\n var messageText = html.find('[name=\"message\"]')[0].value\n }\nif(!applyChanges)return;\n ChatMessage.create({\n content: messageText,\n whisper: targets\n });\n}","flags":{"core":{"sourceId":"Compendium.foundry_community_macros.community-macros-misc.QTDeg4HOYCAmr4dK"}},"ownership":{"default":2,"Hp9ImM4o9YRTSdfu":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.15","coreVersion":"10.291","createdTime":1671237211578,"modifiedTime":1671237211578,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"ALAVJEEP3iJosOoi"}
|
||||
{"name":"Terres médianes du rêve","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-normal.svg","command":"const selected = game.system.rdd.RdDUtility.getSelectedActor();\nif (!selected) {\n ui.notifications.info('Pas de personnage sélectionné');\n return;\n}\nif (!selected.isHautRevant()) {\n ui.notifications.info(`Le personnage ${selected.name} n'a pas le don de haut-rêve`);\n return;\n}\n\nconst dialogMoral = new Dialog({\n title: `Monter dans les TMR`,\n content: `Monter dans les TMR`,\n buttons: {\n normale: { label: `normale`, icon: `<img class=\"button-img\" src=\"systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-normal.svg\" alt=\"Montée dans les Terres Médianes !\"/>`, callback: () => selected.displayTMR(\"normal\") },\n rapide: { label: `rapide`, icon: `<img class=\"button-img\" src=\"systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-rapide.svg\" alt=\"Montée accélérée dans les Terres Médianes !\"/>`, callback: () => selected.displayTMR(\"rapide\") },\n },\n});\n\ndialogMoral.render(true)","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.zCAQxg2duk0j3s5r"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.15","coreVersion":"10.291","createdTime":1669250715114,"modifiedTime":1671236057731,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"ERsBfwsodzH6UX4x"}
|
||||
{"name":"Signe draconique","type":"chat","author":"Hp9ImM4o9YRTSdfu","img":"systems/foundryvtt-reve-de-dragon/icons/tmr/signe_draconique.webp","scope":"global","command":"/signe +","flags":{"core":{"sourceId":"Macro.RmOLbONUNnINcqCO"}},"ownership":{"default":0,"klwAm8zAKxw8YBLf":3,"Hp9ImM4o9YRTSdfu":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.15","coreVersion":"10.291","createdTime":1671237375774,"modifiedTime":1671237375774,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"MJByzsEdneZ64P56"}
|
||||
{"name":"Appel à la chance","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/commodities/flowers/clover.webp","command":"const selected = game.system.rdd.RdDUtility.getSelectedActor();\nif (selected) {\n selected.rollAppelChance();\n}\nelse {\n ui.notifications.info('Pas de personnage sélectionné');\n}","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.XHNbjnGKXaCiCadq"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.15","coreVersion":"10.291","createdTime":1671220038331,"modifiedTime":1671233849101,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"UzAWljmFq5sY702w"}
|
||||
{"name":"Encaissement","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/svg/bones.svg","command":"const selected = game.system.rdd.RdDUtility.getSelectedActor();\nif (selected) {\n selected.encaisser();\n}\nelse {\n ui.notifications.info('Pas de personnage sélectionné');\n}","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.XHNbjnGKXaCiCadq"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.15","coreVersion":"10.291","createdTime":1671220038331,"modifiedTime":1671234017623,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"WD6T8AdRbX2Ylxqe"}
|
||||
{"name":"Jet quelconque","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/sundries/gaming/dice-runed-tan.webp","command":"const selected = game.system.rdd.RdDUtility.getSelectedActor();\nif (selected) {\n selected.roll();\n}\nelse {\n ui.notifications.info('Pas de personnage sélectionné');\n}","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.XHNbjnGKXaCiCadq"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.15","coreVersion":"10.291","createdTime":1671220038331,"modifiedTime":1671233500655,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"bnJnbKDHpbqY8Pr9"}
|
||||
{"name":"Jet de moral","type":"script","author":"Hp9ImM4o9YRTSdfu","img":"icons/magic/control/mouth-smile-deception-purple.webp","scope":"global","command":"const selected = game.system.rdd.RdDUtility.getSelectedActor();\nif (!selected) {\n ui.notifications.info('Pas de personnage sélectionné');\n return;\n}\n\nconst dialogMoral = new Dialog({\n title: `Jet de moral`,\n content: `Jet de moral en situation`,\n buttons: {\n malheureuse: { label: `malheureuse`, icon: \"<i class='fa-regular fa-face-frown'></i>\", callback: () => selected.jetDeMoral('malheureuse') },\n neutre: { label: `neutre`, icon: \"<i class='fa-regular fa-face-meh'></i>\", callback: () => selected.jetDeMoral('neutre') },\n heureuse: { label: `heureuse`, icon: \"<i class='fa-regular fa-face-smile'></i>\", callback: () => selected.jetDeMoral('heureuse') }\n },\n});\n\ndialogMoral.render(true)","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.aJ0QGnXAXT0WiXbk"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"11.1.0","coreVersion":"10.291","createdTime":1671235038906,"modifiedTime":1671236054480,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"2VvH2rmxV33jGjMU"}
|
||||
{"name":"Repos","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/svg/sleep.svg","command":"const selected = game.system.rdd.RdDUtility.getSelectedActor();\nif (selected) {\n selected.repos();\n}\nelse {\n ui.notifications.info('Pas de personnage sélectionné');\n}","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.XHNbjnGKXaCiCadq"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"11.1.0","coreVersion":"10.291","createdTime":1671220038331,"modifiedTime":1671234271278,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"6LRZ8DOVfqotIEsi"}
|
||||
{"name":"Météo marine","type":"chat","author":"Hp9ImM4o9YRTSdfu","img":"icons/magic/air/wind-weather-sailing-ship.webp","scope":"global","command":"/meteo","flags":{"core":{"sourceId":"Macro.EPhCYk7PFMPlIFhS"}},"ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"11.1.0","coreVersion":"10.291","createdTime":1671237060687,"modifiedTime":1671237060687,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"9mYZfKoi4ZYHydxa"}
|
||||
{"name":"Chuchoter aux joueurs","type":"script","author":"Hp9ImM4o9YRTSdfu","img":"icons/svg/deaf.svg","scope":"global","command":"/** \n * Provides a dialog to whisper specific players. If you have tokens selected, it will automatically default to try and whisper those players.\n * @Author: Nelson#3570\n */\n\nlet applyChanges = false;\n\nlet users = game.users.filter(user => user.active);\nlet checkOptions = \"\"\nlet playerTokenIds = users.map(u => u.character?.id).filter(id => id !== undefined);\nlet selectedPlayerIds = canvas.tokens.controlled.map(token => {\n if (playerTokenIds.includes(token.actor.id)) return token.actor.id;\n});\n\n// Build checkbox list for all active players\nusers.forEach(user => {\n let checked = !!user.character && selectedPlayerIds.includes(user.character.id) && 'checked';\n checkOptions+=`\n <br>\n <input type=\"checkbox\" name=\"${user.id}\" id=\"${user.id}\" value=\"${user.name}\" ${checked}>\\n\n <label for=\"${user.id}\">${user.name}</label>\n `\n});\n\nnew Dialog({\n title:\"Whisper\",\n content:`Whisper To: ${checkOptions} <br>\n <label for=\"message\">Message:</label>\n <textarea id=\"message\" name=\"message\" rows=\"4\" cols=\"50\"></textarea><br>`,\n buttons:{\n whisper:{ \n label:\"Whisper\",\n callback: (html) => createMessage(html)\n }\n }\n}).render(true);\n\nfunction createMessage(html) {\n var targets = [];\n // build list of selected players ids for whispers target\n for ( let user of users ) {\n if (html.find('[name=\"'+user.id+'\"]')[0].checked){\n applyChanges=true;\n targets.push(user.id);\n }\n var messageText = html.find('[name=\"message\"]')[0].value\n }\nif(!applyChanges)return;\n ChatMessage.create({\n content: messageText,\n whisper: targets\n });\n}","flags":{"core":{"sourceId":"Compendium.foundry_community_macros.community-macros-misc.QTDeg4HOYCAmr4dK"}},"ownership":{"default":2,"Hp9ImM4o9YRTSdfu":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"11.1.0","coreVersion":"10.291","createdTime":1671237211578,"modifiedTime":1671237211578,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"ALAVJEEP3iJosOoi"}
|
||||
{"name":"Terres médianes du rêve","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-normal.svg","command":"const selected = game.system.rdd.RdDUtility.getSelectedActor();\nif (!selected) {\n ui.notifications.info('Pas de personnage sélectionné');\n return;\n}\nif (!selected.isHautRevant()) {\n ui.notifications.info(`Le personnage ${selected.name} n'a pas le don de haut-rêve`);\n return;\n}\n\nconst dialogMoral = new Dialog({\n title: `Monter dans les TMR`,\n content: `Monter dans les TMR`,\n buttons: {\n normale: { label: `normale`, icon: `<img class=\"button-img\" src=\"systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-normal.svg\" alt=\"Montée dans les Terres Médianes !\"/>`, callback: () => selected.displayTMR(\"normal\") },\n rapide: { label: `rapide`, icon: `<img class=\"button-img\" src=\"systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-rapide.svg\" alt=\"Montée accélérée dans les Terres Médianes !\"/>`, callback: () => selected.displayTMR(\"rapide\") },\n },\n});\n\ndialogMoral.render(true)","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.zCAQxg2duk0j3s5r"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"11.1.0","coreVersion":"10.291","createdTime":1669250715114,"modifiedTime":1671236057731,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"ERsBfwsodzH6UX4x"}
|
||||
{"name":"Signe draconique","type":"chat","author":"Hp9ImM4o9YRTSdfu","img":"systems/foundryvtt-reve-de-dragon/icons/tmr/signe_draconique.webp","scope":"global","command":"/signe +","flags":{"core":{"sourceId":"Macro.RmOLbONUNnINcqCO"}},"ownership":{"default":0,"klwAm8zAKxw8YBLf":3,"Hp9ImM4o9YRTSdfu":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"11.1.0","coreVersion":"10.291","createdTime":1671237375774,"modifiedTime":1671237375774,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"MJByzsEdneZ64P56"}
|
||||
{"name":"Appel à la chance","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/commodities/flowers/clover.webp","command":"const selected = game.system.rdd.RdDUtility.getSelectedActor();\nif (selected) {\n selected.rollAppelChance();\n}\nelse {\n ui.notifications.info('Pas de personnage sélectionné');\n}","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.XHNbjnGKXaCiCadq"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"11.1.0","coreVersion":"10.291","createdTime":1671220038331,"modifiedTime":1671233849101,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"UzAWljmFq5sY702w"}
|
||||
{"name":"Encaissement","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/svg/bones.svg","command":"const selected = game.system.rdd.RdDUtility.getSelectedActor();\nif (selected) {\n selected.encaisser();\n}\nelse {\n ui.notifications.info('Pas de personnage sélectionné');\n}","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.XHNbjnGKXaCiCadq"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"11.1.0","coreVersion":"10.291","createdTime":1671220038331,"modifiedTime":1671234017623,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"WD6T8AdRbX2Ylxqe"}
|
||||
{"name":"Jet quelconque","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/sundries/gaming/dice-runed-tan.webp","command":"const selected = game.system.rdd.RdDUtility.getSelectedActor();\nif (selected) {\n selected.roll();\n}\nelse {\n ui.notifications.info('Pas de personnage sélectionné');\n}","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.XHNbjnGKXaCiCadq"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"11.1.0","coreVersion":"10.291","createdTime":1671220038331,"modifiedTime":1671233500655,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"bnJnbKDHpbqY8Pr9"}
|
||||
{"name":"Recherche et tirage","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/tools/scribal/magnifying-glass.webp","command":"game.system.rdd.commands.tirage()","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.ZFWPNdQBjQs9z0YW"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.5.4","coreVersion":"10.291","createdTime":1673472449426,"modifiedTime":1673655461651,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"iVZnxOxhCMpkvYh3"}
|
||||
{"name":"Thème astral","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/magic/nature/symbol-moon-stars-white.webp","command":"game.system.rdd.AppAstrologie.create()","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.oA0HPFeFK6YMspAX"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.19","coreVersion":"10.291","createdTime":1678127868791,"modifiedTime":1678237392810,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"koqhiDJSGP4gQ4vf"}
|
||||
{"name":"Jet d'éthylisme","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/consumables/drinks/alcohol-beer-stein-wooden-metal-brown.webp","command":"const selected = game.system.rdd.RdDUtility.getSelectedActor();\nif (selected) {\n selected.jetEthylisme();\n}\nelse {\n ui.notifications.info('Pas de personnage sélectionné');\n}","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.XHNbjnGKXaCiCadq"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.15","coreVersion":"10.291","createdTime":1671220038331,"modifiedTime":1671233646086,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"mvub1dRHNFmWjRr7"}
|
||||
{"name":"Tirer le tarot","type":"chat","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.webp","command":"/tirer tarot","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.HBZSKR9OHCQbLcTC"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.15","coreVersion":"10.291","createdTime":1669469547231,"modifiedTime":1671237401618,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"vTfJTFYYiRu8X5LM"}
|
||||
{"name":"Jet d'éthylisme","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/consumables/drinks/alcohol-beer-stein-wooden-metal-brown.webp","command":"const selected = game.system.rdd.RdDUtility.getSelectedActor();\nif (selected) {\n selected.jetEthylisme();\n}\nelse {\n ui.notifications.info('Pas de personnage sélectionné');\n}","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.XHNbjnGKXaCiCadq"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"11.1.0","coreVersion":"10.291","createdTime":1671220038331,"modifiedTime":1671233646086,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"mvub1dRHNFmWjRr7"}
|
||||
{"name":"Tirer le tarot","type":"chat","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.webp","command":"/tirer tarot","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.HBZSKR9OHCQbLcTC"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"11.1.0","coreVersion":"10.291","createdTime":1669469547231,"modifiedTime":1671237401618,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"vTfJTFYYiRu8X5LM"}
|
||||
{"name": "Mon personnage","type": "script","author": "Hp9ImM4o9YRTSdfu","img": "systems/foundryvtt-reve-de-dragon/icons/voyageurs/token_hr_dilettante.webp","scope": "global","command": "if (game.user.isGM) {\n ui.notifications.warn(\"En tant que gardien, vous n'avez pas de personnage attitré\")\n return\n}\nconst actor = game.users.get(game.userId)?.character\nif (!actor) {\n ui.notifications.warn(\"Vous n'avez pas de personnage attitré\")\n return\n}\nactor.sheet.render(true)","folder": null,"flags": {"core": {},"exportSource": {"world": "graine","system": "foundryvtt-reve-de-dragon","coreVersion": "11.313","systemVersion": "11.1.1"}},"_stats": {"systemId": "foundryvtt-reve-de-dragon","systemVersion": "11.1.1","coreVersion": "11.313","createdTime": 1699477824379,"modifiedTime": 1699485023429,"lastModifiedBy": "Hp9ImM4o9YRTSdfu"}}
|
||||
|
@ -1,3 +0,0 @@
|
||||
{"_id":"dlvK5Lks7WoSZ1Ko","name":"1er soins - Blessure critique","type":"tache","flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.taches-courantes.dlvK5Lks7WoSZ1Ko"}},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_chirurgie.webp","effects":[],"system":{"description":"<p><span class=\"fontstyle0\">Effectuer les premiers soins consiste à obtenir le nombre de points de tâche demandé par la blessure. Un minimum de matériel est nécessaire : de l’eau, des chiffons propres pour servir de pansements.</span></p>\n<p> </p>","descriptionmj":"","carac":"dexterite","competence":"Chirurgie","periodicite":"1 round","fatigue":0,"difficulte":-6,"points_de_tache":6,"points_de_tache_courant":0,"nb_jet_echec":0,"nb_jet_succes":0,"cacher_points_de_tache":false},"ownership":{"default":0,"Q2G6GTdrotKzYGUC":3},"folder":null,"sort":0,"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.13","coreVersion":"10.291","createdTime":1671050458426,"modifiedTime":1671050514673,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
||||
{"_id":"lHdfav9mvs68yj7J","name":"1er soins - Blessure légère","type":"tache","flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.taches-courantes.lHdfav9mvs68yj7J"}},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_chirurgie.webp","effects":[],"system":{"description":"<p><span class=\"fontstyle0\">Effectuer les premiers soins consiste à obtenir le nombre de points de tâche demandé par la blessure. Un minimum de matériel est nécessaire : de l’eau, des chiffons propres pour servir de pansements.</span></p>\n<p> </p>","descriptionmj":"","carac":"dexterite","competence":"Chirurgie","periodicite":"1 round","fatigue":0,"difficulte":-2,"points_de_tache":2,"points_de_tache_courant":0,"nb_jet_echec":0,"nb_jet_succes":0,"cacher_points_de_tache":false},"ownership":{"default":0,"Q2G6GTdrotKzYGUC":3},"folder":null,"sort":0,"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.13","coreVersion":"10.291","createdTime":1671050458426,"modifiedTime":1671050514673,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
||||
{"_id":"nbkuXbhgSxHwXD4t","name":"1er soins - Blessure grave","type":"tache","flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.taches-courantes.nbkuXbhgSxHwXD4t"}},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_chirurgie.webp","effects":[],"system":{"description":"<p><span class=\"fontstyle0\">Effectuer les premiers soins consiste à obtenir le nombre de points de tâche demandé par la blessure. Un minimum de matériel est nécessaire : de l’eau, des chiffons propres pour servir de pansements.</span></p>\n<p> </p>","descriptionmj":"","carac":"dexterite","competence":"Chirurgie","periodicite":"1 round","fatigue":0,"difficulte":-4,"points_de_tache":4,"points_de_tache_courant":0,"nb_jet_echec":0,"nb_jet_succes":0,"cacher_points_de_tache":false},"ownership":{"default":0,"Q2G6GTdrotKzYGUC":3},"folder":null,"sort":0,"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.13","coreVersion":"10.291","createdTime":1671050458427,"modifiedTime":1671050514673,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
@ -776,7 +776,7 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) {
|
||||
}
|
||||
.rdd-diviseur{
|
||||
border-radius: 6px; padding: 3px;
|
||||
background: var(--gradient-silver-light);
|
||||
background: var(--gradient-red);
|
||||
}
|
||||
|
||||
.rdd-niveau-requis{
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"id": "foundryvtt-reve-de-dragon",
|
||||
"title": "Rêve de Dragon",
|
||||
"version": "11.0.26",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-11.0.26.zip",
|
||||
"version": "11.1.6",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-11.1.6.zip",
|
||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v11/system.json",
|
||||
"changelog": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md",
|
||||
"compatibility": {
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
<li class="item flexrow">
|
||||
<label class="generic-label">
|
||||
Niveaux {{numberFormat archetype.niveau decimals=0 sign=true}} : {{archetype.nombre}} / {{archetype.nombreMax}}
|
||||
Niveaux {{plusMoins archetype.niveau}} : {{archetype.nombre}} / {{archetype.nombreMax}}
|
||||
</label>
|
||||
</li>
|
||||
{{/each}}
|
||||
|
@ -68,7 +68,7 @@
|
||||
</li>
|
||||
<li class="caracteristique flexrow list-item" >
|
||||
<label class="carac-label">Bonus dom.</label>
|
||||
<input class="derivee-value" type="text" disabled value="{{numberFormat system.attributs.plusdom.value decimals=0 sign=true}}"/>
|
||||
<input class="derivee-value" type="text" disabled value="{{plusMoins system.attributs.plusdom.value}}"/>
|
||||
</li>
|
||||
<li class="caracteristique flexrow list-item" >
|
||||
<label class="carac-label">Malus armure</label>
|
||||
|
@ -20,8 +20,8 @@
|
||||
</a>
|
||||
({{arme.system.competence}})
|
||||
</span>
|
||||
<span class="competence-value">{{numberFormat arme.system.niveau decimals=0 sign=true}}</span>
|
||||
<span class="competence-value">{{numberFormat arme.system.dommagesReels decimals=0 sign=true}}</span>
|
||||
<span class="competence-value">{{plusMoins arme.system.niveau}}</span>
|
||||
<span class="competence-value">{{plusMoins arme.system.dommagesReels}}</span>
|
||||
<span class="competence-value"></span>
|
||||
<span class="initiative-value arme-initiative"><a>{{arme.system.initiative}}</a></span>
|
||||
</li>
|
||||
@ -34,7 +34,7 @@
|
||||
<span>{{esq.name}}</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class="competence-value">{{numberFormat esq.system.niveau decimals=0 sign=true}}</span>
|
||||
<span class="competence-value">{{plusMoins esq.system.niveau}}</span>
|
||||
<span class="competence-value"></span>
|
||||
<span class="competence-value"></span>
|
||||
<span class="initiative-value"></span>
|
||||
|
@ -11,13 +11,13 @@
|
||||
{{#unless @root.options.vueDetaillee}}disabled{{/unless}}/>
|
||||
<input class="competence-value creature-niveau" type="text" data-dtype="number"
|
||||
compname="{{comp.name}}" name="{{comp._id}}.niveau"
|
||||
value="{{numberFormat comp.system.niveau decimals=0 sign=true}}"
|
||||
value="{{plusMoins comp.system.niveau}}"
|
||||
{{#unless @root.options.vueDetaillee}}disabled{{/unless}}
|
||||
/>
|
||||
<input class="competence-damage creature-dommages" type="text" data-dtype="number"
|
||||
{{#if comp.isdommages}}
|
||||
compname="{{comp.name}}" name="{{comp._id}}.dommages"
|
||||
value="{{numberFormat comp.system.dommages decimals=0 sign=true}}"
|
||||
value="{{plusMoins comp.system.dommages}}"
|
||||
{{#unless @root.options.vueDetaillee}}disabled{{/unless}}
|
||||
{{else}}disabled{{/if}}
|
||||
/>
|
||||
|
@ -13,7 +13,7 @@
|
||||
{{/if}}
|
||||
|
||||
<input class="competence-value" type="text" compname="{{name}}" name="comp-value-{{name}}"
|
||||
value="{{numberFormat system.niveau decimals=0 sign=true}}" data-dtype="number"
|
||||
value="{{plusMoins system.niveau}}" data-dtype="number"
|
||||
{{#if (or (not @root.options.vueDetaillee) @root.options.vueArchetype)}}disabled{{/if}} />
|
||||
|
||||
{{#if @root.options.vueDetaillee}}
|
||||
@ -42,7 +42,7 @@
|
||||
<i class="far fa-circle"></i>
|
||||
{{/if}}
|
||||
<input class="competence-archetype niveau-archetype" type="text" compname="{{name}}" name="comp-archetype-{{name}}"
|
||||
value="{{numberFormat system.niveau_archetype decimals=0 sign=true}}" data-dtype="number"
|
||||
value="{{plusMoins system.niveau_archetype}}" data-dtype="number"
|
||||
{{#if (not @root.options.vueArchetype)}}disabled{{/if}} />
|
||||
<a class="item-edit" title="Modifier"><i class="fas fa-edit"></i></a>
|
||||
{{#if @root.options.isGM}}
|
||||
|
@ -2,11 +2,11 @@
|
||||
{{#if effects}}
|
||||
{{#each effects as |effect key|}}
|
||||
<span class="active-effect" data-effect="{{effect.flags.core.statusId}}">
|
||||
<img class="button-effect-img {{#if @root.options.isGM}}delete-active-effect{{/if}}" src="{{effect.icon}}" alt="{{localize effect.label}}" width="24" height="24" />
|
||||
<img class="button-effect-img {{#if @root.options.isGM}}delete-active-effect{{/if}}" src="{{effect.icon}}" alt="{{localize effect.name}}" width="24" height="24" />
|
||||
</span>
|
||||
{{/each}}
|
||||
{{#if calc.surprise}}<span>{{calc.surprise}}!</span>{{/if}}
|
||||
{{else}}
|
||||
{{else}}
|
||||
Aucun effet actif
|
||||
{{/if}}
|
||||
</div>
|
||||
|
1
templates/chat-actor-turn-acteur.hbs
Normal file
1
templates/chat-actor-turn-acteur.hbs
Normal file
@ -0,0 +1 @@
|
||||
<h4>C'est au tour de {{alias}} !</h4>
|
@ -1,4 +1,4 @@
|
||||
<h4>C'est au tour de {{alias}} !</h4>
|
||||
<h4>Résumé de santé pour {{alias}}</h4>
|
||||
<div data-combatid="{{combatId}}" data-combatmessage="actor-turn-summary">{{blessuresStatus}}</div>
|
||||
<div>Son état général est de : {{etatGeneral}} {{#if isSonne}} et est <strong>sonné</strong>{{/if}}</div>
|
||||
{{#if isGrave}}
|
||||
@ -6,5 +6,7 @@
|
||||
{{/if}}
|
||||
{{#if isCritique}}
|
||||
<div>{{alias}} souffre d'une <strong>Blessure Critique</strong> : faites un
|
||||
<a id="chat-jet-vie" class="chat-card-button" data-actorId="{{actorId}}">Jet de Vie.<a></div>
|
||||
<a class="chat-card-button chat-jet-vie"
|
||||
data-tokenId="{{tokenId}}"
|
||||
data-actorId="{{actorId}}">Jet de Vie.<a></div>
|
||||
{{/if}}
|
@ -63,11 +63,10 @@
|
||||
{{/unless}}
|
||||
<a class='chat-card-button' id='encaisser-button' data-attackerId='{{attackerId}}'
|
||||
data-defenderTokenId='{{defenderTokenId}}'>
|
||||
Encaisser à {{#if (eq dmg.mortalite 'non-mortel')~}}
|
||||
({{numberFormat dmg.total decimals=0 sign=true}})
|
||||
{{~else~}}
|
||||
{{numberFormat dmg.total decimals=0 sign=true}}
|
||||
{{~/if}} !
|
||||
Encaisser à {{plusMoins dmg.total}}
|
||||
{{#if (eq dmg.mortalite 'non-mortel')~}}
|
||||
(non-mortel) !
|
||||
{{/if}}
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
@ -1,6 +1,6 @@
|
||||
<div>
|
||||
<span {{#if ajustements}}class="tooltip tooltip-dotted" {{/if}}>
|
||||
{{rolled.caracValue}} à {{numberFormat rolled.finalLevel decimals=0 sign=true}}
|
||||
{{rolled.caracValue}} à {{plusMoins rolled.finalLevel}}
|
||||
{{#if ajustements}}
|
||||
<div class="tooltiptext ttt-ajustements">
|
||||
{{#each ajustements as |item key|}}
|
||||
@ -9,7 +9,7 @@
|
||||
{{#if item.descr}}
|
||||
{{{item.descr}}}
|
||||
{{else}}
|
||||
{{item.label}}: {{numberFormat item.value decimals=0 sign=true}}
|
||||
{{item.label}}: {{plusMoins item.value}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
@ -19,10 +19,13 @@
|
||||
{{#if rolled.factorHtml}}<span class="rdd-diviseur">×{{{rolled.factorHtml}}}</span>{{/if}}
|
||||
</span>
|
||||
<span>= {{rolled.score}}%</span>
|
||||
{{#if rolled.factorHtml}}
|
||||
<span class="rdd-diviseur">×{{{rolled.factorHtml}}}</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div>
|
||||
<span>{{rolled.roll}} : </span><span class="rdd-roll-{{rolled.code}} strong-text">{{rolled.quality}}</span>
|
||||
{{#if rolled.ajustementNecessaire}}
|
||||
<span class="rdd-niveau-requis">(Réussite si {{numberFormat rolled.niveauNecessaire decimals=0 sign=true}} / avec niveau {{numberFormat rolled.ajustementNecessaire decimals=0 sign=true}}) </span>
|
||||
<span class="rdd-niveau-requis">(Réussite si {{plusMoins rolled.niveauNecessaire}} / avec niveau {{plusMoins rolled.ajustementNecessaire}}) </span>
|
||||
{{/if}}
|
||||
</div>
|
@ -20,11 +20,11 @@
|
||||
{{#if rolled.isSuccess}}
|
||||
<span><strong>{{show.cible}}</strong> doit se défendre à <strong>{{diffLibre}}</strong>, ou encaisser à
|
||||
{{~#if (eq dmg.mortalite 'non-mortel')}}
|
||||
<span class="rdd-roll-norm">({{numberFormat dmg.total decimals=0 sign=true}})</span> (dommages non-mortel)
|
||||
<span class="rdd-roll-norm">({{plusMoins dmg.total}})</span> (non-mortel)
|
||||
{{else if (eq dmg.mortalite 'mortel')}}
|
||||
<span class="rdd-roll-echec">{{numberFormat dmg.total decimals=0 sign=true}}</span>
|
||||
<span class="rdd-roll-echec">{{plusMoins dmg.total}}</span>
|
||||
{{else}}
|
||||
<span class="rdd-roll-etotal">{{numberFormat dmg.total decimals=0 sign=true}}</span> (entités de cauchemar)
|
||||
<span class="rdd-roll-etotal">{{plusMoins dmg.total}}</span> (entités de cauchemar)
|
||||
{{~/if}}.
|
||||
{{#if show.isRecul}}Si votre adversaire n'esquive pas, il devra résister à l'impact ou reculer sous le choc!{{/if}}
|
||||
</span>
|
||||
|
@ -10,7 +10,7 @@
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
||||
<hr>
|
||||
<div>
|
||||
<span>{{#if rolled.ptTache}}{{rolled.ptTache}} points de tâche{{/if}}{{#if rolled.ptQualite}}{{#if rolled.ptTache}},{{/if}} Qualité ajustée de {{numberFormat rolled.ptQualite decimals=0 sign=true}}{{/if}}</span>
|
||||
<span>{{#if rolled.ptTache}}{{rolled.ptTache}} points de tâche{{/if}}{{#if rolled.ptQualite}}{{#if rolled.ptTache}},{{/if}} Qualité ajustée de {{rolled.ptQualite}}{{/if}}</span>
|
||||
</div>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html"}}
|
||||
{{~#if show.explications}}
|
||||
|
@ -10,7 +10,7 @@
|
||||
{{else}}
|
||||
<h4>{{alias}} encaisse à
|
||||
<span>
|
||||
{{numberFormat dmg.total decimals=0 sign=true}}
|
||||
{{plusMoins dmg.total}}
|
||||
{{#if (eq dmg.mortalite 'non-mortel')~}}(coups non mortels)
|
||||
{{~else if (eq dmg.mortalite 'entiteincarnee')}}(entité incarnée)
|
||||
{{~/if}}
|
||||
@ -26,7 +26,7 @@
|
||||
{{#if (eq dmg.mortalite 'entiteincarnee')}}subit le coup
|
||||
{{else if mort}}vient de mourir
|
||||
{{else if blessure}}
|
||||
{{#if (gt blessure.system.gravite 0)}}subit une blessure {{blessure.system.labelGravite}}
|
||||
{{#if (gt blessure.system.gravite 0)}}subit une blessure {{blessure.system.label}}
|
||||
{{else}}subit une contusion
|
||||
{{~/if~}}
|
||||
{{else}}s'en sort sans une égratignure
|
||||
@ -44,7 +44,7 @@
|
||||
{{#if (ne dmg.mortalite 'entiteincarnee')}}
|
||||
{{#if (gt endurance 1)}}et
|
||||
{{#if sonne}}est <strong>sonné</strong><img class="chat-icon" src="icons/svg/stoned.svg" alt="charge" height="16" width="16" /> jusqu'à la fin du prochain round{{else}}n'est pas sonné{{/if}}!
|
||||
{{#if hasPlayerOwner}}Jet d'endurance : Jet d'endurance : {{jetEndurance}} / {{resteEndurance}}{{/if}}
|
||||
{{#if hasPlayerOwner}}Jet d'endurance : {{jetEndurance}} / {{resteEndurance}}{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
@ -5,13 +5,13 @@
|
||||
{{alias}} {{#if show.title}}{{show.title}}: {{/if}}
|
||||
{{#if selectedCarac}}{{selectedCarac.label}}
|
||||
{{#if competence}}{{#unless (eq selectedCarac.label competence.name)}} / {{competence.name}}{{/unless}}{{/if}}
|
||||
à {{diffLibre}}
|
||||
à {{plusMoins diffLibre}}
|
||||
{{/if}}
|
||||
</h4>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
||||
<hr>
|
||||
<div>
|
||||
<span>{{#if rolled.ptTache}}{{rolled.ptTache}} points de tâche{{/if}}{{#if rolled.ptQualite}}{{#if rolled.ptTache}},{{/if}} ajustement Qualité {{numberFormat rolled.ptQualite decimals=0 sign=true}}{{/if}}</span>
|
||||
<span>{{#if rolled.ptTache}}{{rolled.ptTache}} points de tâche{{/if}}{{#if rolled.ptQualite}}{{#if rolled.ptTache}},{{/if}} ajustement Qualité {{rolled.ptQualite}}{{/if}}</span>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html"}}
|
||||
</div>
|
||||
{{~#if show.explications}}
|
||||
|
@ -3,7 +3,7 @@
|
||||
<ul>
|
||||
<li>Vent: {{lowerFirst vent.description}} {{apostrophe 'de' vent.direction}}, force {{vent.force}}</li>
|
||||
<li>Mer {{lowerFirst mer.description}}, {{apostrophe 'de' mer.direction}}, force {{mer.force}}</li>
|
||||
<li>Température {{lowerFirst temperature.description}} ({{numberFormat temperature.force decimals=0 sign=true}})</li>
|
||||
<li>Température {{lowerFirst temperature.description}} ({{plusMoins temperature.force}})</li>
|
||||
<li>Couverture nuageuse: {{lowerFirst nuage.description}}</li>
|
||||
<li>Pluie: {{lowerFirst pluie.description}}</li>
|
||||
</div>
|
||||
|
@ -64,14 +64,17 @@
|
||||
{{/if}}
|
||||
{{#if (gt item.system.qualite 0)}}
|
||||
{{#if (gt item.system.qualite cuisine.system.niveau)}}
|
||||
<p>La qualité du plat est telle qu'un jet de Goût/Cuisine à {{numberFormat item.system.qualite decimals=0 sign=true}}
|
||||
vous permettra un jet de moral heureux.</p>
|
||||
<p>La qualité du plat est telle qu'un jet de Goût réussi vous permettra un jet de moral heureux.</p>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if (or (lt item.system.qualite 0) (lt item.system.exotisme 0))}}
|
||||
<p>
|
||||
Pour surmonter {{#if (lt item.system.qualite 0)}}le mauvais goût{{else}}l'exotisme{{/if}}, vous devez effectuer un jet de Volonté/Cuisine à {{numberFormat (min item.system.exotisme item.system.qualite) decimals=0 sign=true}}.
|
||||
{{#if (lt item.system.qualite 0)}}
|
||||
Pour surmonter le mauvais goût, vous devez effectuer un jet de Volonté à {{plusMoins (min item.system.exotisme item.system.qualite)}}.
|
||||
{{else}}
|
||||
Pour surmonter l'exotisme, vous devez effectuer un jet de Volonté/Cuisine à {{plusMoins (min item.system.exotisme)}}.
|
||||
{{/if}}
|
||||
<br/>
|
||||
<input class="attribute-value se-forcer" type="checkbox" name="se-forcer" {{#if choix.seForcer}}checked{{/if}}>
|
||||
<label for="se-forcer">En cas d'échec, voulez-vous vous forcer à manger (et subir un jet de moral en situation malheureuse)?</label>
|
||||
|
@ -19,14 +19,17 @@
|
||||
{{/if}}
|
||||
{{#if (gt item.system.qualite 0)}}
|
||||
{{#if (gt item.system.qualite cuisine.system.niveau)}}
|
||||
<p>La qualité du plat est telle qu'un jet de Goût/Cuisine à {{numberFormat item.system.qualite decimals=0 sign=true}}
|
||||
vous permettra un jet de moral heureux.</p>
|
||||
<p>La qualité du plat est telle qu'un jet de Goût vous permettra un jet de moral heureux.</p>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if (or (lt item.system.qualite 0) (lt item.system.exotisme 0))}}
|
||||
<p>
|
||||
Pour surmonter {{#if (lt item.system.qualite 0)}}le mauvais goût{{else}}l'exotisme{{/if}}, vous devez effectuer un jet de Volonté/Cuisine à {{numberFormat (min item.system.exotisme item.system.qualite) decimals=0 sign=true}}.
|
||||
{{#if (lt item.system.qualite 0)}}
|
||||
Pour surmonter le mauvais goût, vous devez effectuer un jet de Volonté à {{plusMoins (min item.system.exotisme item.system.qualite)}}.
|
||||
{{else}}
|
||||
Pour surmonter l'exotisme, vous devez effectuer un jet de Volonté/Cuisine à {{plusMoins (min item.system.exotisme)}}.
|
||||
{{/if}}
|
||||
<br/>
|
||||
<input class="attribute-value se-forcer" type="checkbox" name="se-forcer" {{#if choix.seForcer}}checked{{/if}}>
|
||||
<label for="se-forcer">En cas d'échec, voulez-vous vous forcer à manger (et subir un jet de moral en situation malheureuse)?</label>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<div class="grid grid-2col">
|
||||
<label>{{alchimie.tache}}:</label><label class="flex-grow">{{alchimie.texte}}</label>
|
||||
<label>Caractéristique: </label><label class="flex-grow">{{selectedCarac.label}}</label>
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.system.niveau decimals=0 sign=true}}</label></label>
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{plusMoins competence.system.niveau}}</label></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-group-left">
|
||||
|
@ -6,7 +6,7 @@
|
||||
<img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}" />
|
||||
<div class="grid grid-2col">
|
||||
<label>Caractéristique: </label><label class="flex-grow">{{selectedCarac.label}}</label>
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.system.niveau decimals=0 sign=true}}</label></label>
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{plusMoins competence.system.niveau}}</label></label>
|
||||
</div>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.system}}
|
||||
</div>
|
||||
|
@ -1,13 +1,29 @@
|
||||
<form class="skill-roll-dialog">
|
||||
<img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}"/>
|
||||
<h2 class="dialog-roll-title"></h2>
|
||||
|
||||
<div class="grid grid-2col">
|
||||
<div class="flex-group-left">
|
||||
<img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}"/>
|
||||
<div class="flexrow">
|
||||
<label>Caractéristique</label>
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-select-carac.html"}}
|
||||
<span>
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-select-carac.html"}}
|
||||
</span>
|
||||
</div>
|
||||
{{#if targetToken}}
|
||||
<div class="flexrow">
|
||||
<label>Cible:</label>
|
||||
<label>
|
||||
<img class="sheet-competence-img" src="{{targetToken.img}}" title="{{targetToken.name}}" />
|
||||
{{targetToken.name}}
|
||||
</label>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if ajustements.attaqueDefenseurSurpris.used}}
|
||||
<div class="flexrow">
|
||||
<label>{{ajustements.attaqueDefenseurSurpris.label}}</label>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if arme}}
|
||||
{{#if attackerRoll}}
|
||||
{{#if attackerRoll.tactique}}
|
||||
@ -27,41 +43,28 @@
|
||||
<div class="tooltiptext ttt-ajustements">
|
||||
<div>
|
||||
<strong>Charge</strong> : Les longueurs d'armes n'interviennent pas dans la charge, il faut gérer une initiative aléatoire dans ce cas.
|
||||
<br><strong>Feinte</strong> : Vous devez avoir l'initative sur votre adversaire et y renoncer.
|
||||
<br>
|
||||
<strong>Feinte</strong> : Vous devez avoir l'initative sur votre adversaire et y renoncer.
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if targetToken}}
|
||||
<div class="flexrow">
|
||||
Cible: {{targetToken.name}}
|
||||
<img class="sheet-competence-img" src="{{targetToken.img}}" title="{{targetToken.name}}" />
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if ajustements.attaqueDefenseurSurpris.used}}
|
||||
<div class="flexrow">
|
||||
<label>{{ajustements.attaqueDefenseurSurpris.label}}</label>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#unless attackerRoll}}
|
||||
<div class="flexrow">
|
||||
<label>Dégats:</label>
|
||||
{{#if (eq arme.system.mortalite 'non-mortel')}}
|
||||
<label class="dmg-arme-actor"></label>
|
||||
{{else if (eq arme.system.mortalite 'empoignade')}}
|
||||
{{#if (eq arme.system.mortalite 'empoignade')}}
|
||||
<label>Empoignade</label>
|
||||
{{else}}
|
||||
<span>
|
||||
<input class="attribute-value" type="checkbox" name="motalite" {{#unless (eq mortalite 'mortel')}}checked{{/unless}} />
|
||||
<label class="dmg-arme-actor"></label>
|
||||
{{#unless (eq arme.system.mortalite 'non-mortel')}}
|
||||
<input class="attribute-value check-mortalite" type="checkbox" name="mortalite" {{#unless (eq mortalite 'mortel')}}checked{{/unless}} />
|
||||
{{/unless}}
|
||||
<label class="dmg-arme-actor" name="dmg-arme-actor"></label> (<label class="arme-mortalite" name="arme-mortalite"></label>)
|
||||
</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
<div class="flexrow"></div>
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-surenc.html"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-enctotal.html"}}
|
||||
</div>
|
||||
@ -75,6 +78,7 @@
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-moral.html"}}
|
||||
<div class="flexrow"></div>
|
||||
<div class="placeholder-ajustements" class="flexrow"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}" />
|
||||
<div class="grid grid-2col">
|
||||
<label for="carac">Caractéristique:</label>{{>"systems/foundryvtt-reve-de-dragon/templates/partial-select-carac.html"}}
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.system.niveau decimals=0 sign=true}}</label></label>
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{plusMoins competence.system.niveau}}</label></label>
|
||||
</div>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.system}}
|
||||
</div>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}"/>
|
||||
<div class="grid grid-2col">
|
||||
<label for="carac">{{selectedCarac.label}}:</label><label class="flex-grow" name="carac">{{selectedCarac.value}}</label>
|
||||
<label for="competence">{{competence.name}}:</label><label class="flex-grow" name="competence">{{numberFormat competence.system.niveau decimals=0 sign=true}}</label>
|
||||
<label for="competence">{{competence.name}}:</label><label class="flex-grow" name="competence">{{plusMoins competence.system.niveau}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-group-left">
|
||||
|
@ -9,7 +9,7 @@
|
||||
<img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}"/>
|
||||
<div class="grid grid-2col">
|
||||
<label for="carac">Rêve actuel:</label><label class="flex-grow" name="carac">{{selectedCarac.value}}</label>
|
||||
<label for="competence">{{competence.name}}:</label><label class="flex-grow" name="competence">{{numberFormat competence.system.niveau decimals=0 sign=true}}</label>
|
||||
<label for="competence">{{competence.name}}:</label><label class="flex-grow" name="competence">{{plusMoins competence.system.niveau}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-group-left">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<select class="competence-value flex-shrink" name="modificateurDegats" data-dtype="number">
|
||||
{{#select modificateurDegats}}
|
||||
{{#each ajustementsEncaissement as |key|}}
|
||||
<option value={{key}}>{{numberFormat key decimals=0 sign=true}}</option>
|
||||
<option value={{key}}>{{plusMoins key}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<div class="grid grid-2col">
|
||||
<label>Type:</label><label class="flex-grow">{{oeuvre.system.type}}</label>
|
||||
<label for="carac">Caractéristique:</label>{{>"systems/foundryvtt-reve-de-dragon/templates/partial-select-carac.html"}}
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.system.niveauReel decimals=0 sign=true}}</label></label>
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{plusMoins competence.system.niveauReel}}</label></label>
|
||||
<label>Niveau de base:</label><label class="flex-grow">{{oeuvre.system.base}}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}"/>
|
||||
<div class="grid grid-2col">
|
||||
<label for="carac">Rêve actuel:</label><label class="flex-grow" name="carac">{{selectedCarac.value}}</label>
|
||||
<label for="draconic">{{competence.name}}:</label><label class="flex-grow" name="draconic">{{numberFormat competence.system.niveau decimals=0 sign=true}}</label>
|
||||
<label for="draconic">{{competence.name}}:</label><label class="flex-grow" name="draconic">{{plusMoins competence.system.niveau}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-group-left">
|
||||
|
@ -11,7 +11,7 @@
|
||||
<label>Durée: 60 minutes</label>
|
||||
<hr>
|
||||
<label>Intellect / {{competence.name}}:
|
||||
{{numberFormat carac.intellect.value decimals=0 sign=false}} / {{numberFormat competence.system.niveau decimals=0 sign=true}}</label>
|
||||
{{numberFormat carac.intellect.value decimals=0 sign=false}} / {{plusMoins competence.system.niveau}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-group-left">
|
||||
|
@ -6,7 +6,7 @@
|
||||
<img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}" />
|
||||
<div class="grid grid-2col">
|
||||
<label>Caractéristique: </label><label class="flex-grow">{{selectedCarac.label}}</label>
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.system.niveau decimals=0 sign=true}}</label></label>
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{plusMoins competence.system.niveau}}</label></label>
|
||||
</div>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.system}}
|
||||
</div>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<div class="grid grid-2col">
|
||||
<label>Caractéristique: </label><label class="flex-grow">{{selectedCarac.label}}
|
||||
</label>
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.system.niveau decimals=0 sign=true}}</label></label>
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{plusMoins competence.system.niveau}}</label></label>
|
||||
</div>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.system}}
|
||||
</div>
|
||||
|
@ -9,7 +9,7 @@
|
||||
<label>Caractéristique: </label><label>{{selectedCarac.label}}</label>
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<label>{{competence.name}}: </label><label>{{numberFormat competence.system.niveau decimals=0 sign=true}}</label></label>
|
||||
<label>{{competence.name}}: </label><label>{{plusMoins competence.system.niveau}}</label></label>
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<label>Exotisme: </label><label>{{oeuvre.system.exotisme}}</label>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}"/>
|
||||
<div class="grid grid-2col">
|
||||
<label for="carac">Rêve actuel:</label><label class="flex-grow" name="carac">{{selectedCarac.value}}</label>
|
||||
<label for="competence">{{competence.name}}:</label><label class="flex-grow" name="competence">{{numberFormat competence.system.niveau decimals=0 sign=true}}</label>
|
||||
<label for="competence">{{competence.name}}:</label><label class="flex-grow" name="competence">{{plusMoins competence.system.niveau}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-group-left">
|
||||
|
@ -24,7 +24,7 @@
|
||||
<select name="competence" class="roll-draconic" data-dtype="String">
|
||||
{{#select draconic}}
|
||||
{{#each draconicList as |draconic key|}}
|
||||
<option value={{key}}>{{draconic.name}} : {{numberFormat draconic.system.niveau decimals=0 sign=true}}
|
||||
<option value={{key}}>{{draconic.name}} : {{plusMoins draconic.system.niveau}}
|
||||
</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
|
@ -43,7 +43,7 @@
|
||||
<select name="competence" class="roll-draconic" data-dtype="String">
|
||||
{{#select draconic}}
|
||||
{{#each draconicList as |draconic key|}}
|
||||
<option value={{key}}>{{draconic.name}} : {{numberFormat draconic.system.niveau decimals=0 sign=true}}
|
||||
<option value={{key}}>{{draconic.name}} : {{plusMoins draconic.system.niveau}}
|
||||
</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
@ -54,11 +54,11 @@
|
||||
<select name="diffLibre" class="div-sort-difficulte-var" data-dtype="number">
|
||||
{{#select diffLibre}}
|
||||
{{#each difficultesLibres as |key|}}
|
||||
<option value={{key}}>{{numberFormat key decimals=0 sign=true}}</option>
|
||||
<option value={{key}}>{{plusMoins key}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
<label class="div-sort-difficulte-fixe">{{numberFormat selectedSort.system.difficulte decimals=0 sign=true}}</label>
|
||||
<label class="div-sort-difficulte-fixe">{{plusMoins selectedSort.system.difficulte}}</label>
|
||||
</div>
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html"}}
|
||||
|
@ -1,4 +1,5 @@
|
||||
<form class="tmr-dialog">
|
||||
<h2 class="comptmrdialog" id="tmrDialogTitle" style="visibility: hidden;"></h2>
|
||||
<table>
|
||||
<tr class="tmr-row">
|
||||
<td>
|
||||
@ -52,6 +53,5 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
|
@ -20,22 +20,22 @@
|
||||
{{/if}}
|
||||
<hr>
|
||||
{{#if encaissement.dmg.total}}
|
||||
<div>+dom encaissement: {{numberFormat rollData.dmg.total decimals=0 sign=true}}</div>
|
||||
<div>+dom encaissement: {{plusMoins rollData.dmg.total}}</div>
|
||||
{{/if}}
|
||||
{{#if rollData.dmg.dmgArme}}
|
||||
<div>+dom arme: {{numberFormat rollData.dmg.dmgArme decimals=0 sign=true}}</div>
|
||||
<div>+dom arme: {{plusMoins rollData.dmg.dmgArme}}</div>
|
||||
{{/if}}
|
||||
{{#if rollData.dmg.dmgActor}}
|
||||
<div>+dom attaquant: {{numberFormat rollData.dmg.dmgActor decimals=0 sign=true}}</div>
|
||||
<div>+dom attaquant: {{plusMoins rollData.dmg.dmgActor}}</div>
|
||||
{{/if}}
|
||||
{{#if rollData.dmg.dmgParticuliere}}
|
||||
<div>+dom particulière: {{numberFormat rollData.dmg.dmgParticuliere decimals=0 sign=true}}</div>
|
||||
<div>+dom particulière: {{plusMoins rollData.dmg.dmgParticuliere}}</div>
|
||||
{{/if}}
|
||||
{{#if rollData.dmg.dmgTactique}}
|
||||
<div>+dom tactique: {{numberFormat rollData.dmg.dmgTactique decimals=0 sign=true}}</div>
|
||||
<div>+dom tactique: {{plusMoins rollData.dmg.dmgTactique}}</div>
|
||||
{{/if}}
|
||||
{{#if rollData.dmg.dmgSurprise}}
|
||||
<div>+dom surprise: {{numberFormat rollData.dmg.dmgSurprise decimals=0 sign=true}}</div>
|
||||
<div>+dom surprise: {{plusMoins rollData.dmg.dmgSurprise}}</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</span>
|
||||
|
@ -3,7 +3,7 @@
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
<div class="form-group">
|
||||
<label for="xp">Caractéristique</label>
|
||||
<label for="system.carac">Caractéristique</label>
|
||||
<select name="system.carac" data-dtype="String">
|
||||
{{#select system.carac}}
|
||||
{{#each caracList as |carac key|}}
|
||||
@ -13,7 +13,7 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Compétence</label>
|
||||
<label for="system.competence">Compétence</label>
|
||||
<select name="system.competence" data-dtype="String">
|
||||
{{#select system.competence}}
|
||||
<option value="">Sans compétence</option>
|
||||
@ -22,47 +22,47 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Difficulté</label>
|
||||
<label for="system.difficulte">Difficulté</label>
|
||||
<input class="attribute-value" type="text" name="system.difficulte" value="{{system.difficulte}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Périodicité</label>
|
||||
<label for="system.periodicite">Périodicité</label>
|
||||
<input class="attribute-value" type="text" name="system.periodicite" value="{{system.periodicite}}" data-dtype="String"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Fatigue</label>
|
||||
<label for="system.fatigue">Fatigue</label>
|
||||
<input class="attribute-value" type="text" name="system.fatigue" value="{{system.fatigue}}" data-dtype="Number"/>
|
||||
</div>
|
||||
{{#if options.isGM}}
|
||||
<div class="form-group">
|
||||
<label for="xp">Cacher les Points de Tâches nécessaires au joueur</label>
|
||||
<input class="attribute-value" type="checkbox" name="system.cacher_points_de_tache" value="{{system.cacher_points_de_tache}}" {{checked system.cacher_points_de_tache}}/>
|
||||
<label for="system.cacher_points_de_tache">Cacher les Points de Tâches nécessaires au joueur</label>
|
||||
<input class="attribute-value" ²type="checkbox" name="system.cacher_points_de_tache" {{checked system.cacher_points_de_tache}}/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Points de tâches nécessaires</label>
|
||||
<label for="system.points_de_tache">Points de tâches nécessaires (MJ)</label>
|
||||
<input class="attribute-value" type="text" name="system.points_de_tache" value="{{system.points_de_tache}}" data-dtype="Number"/>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="form-group">
|
||||
<label for="xp">Points de tâches nécessaires</label>
|
||||
{{#if system.cacher_points_de_tache}}
|
||||
<input class="attribute-value" type="text" value="?????" data-dtype="Number" disabled/>
|
||||
{{else}}
|
||||
<input class="attribute-value" type="text" name="system.points_de_tache" value="{{system.points_de_tache}}" data-dtype="Number"/>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{#if system.cacher_points_de_tache}}
|
||||
<label for="system.points_de_tache">Points de tâches nécessaires inconnus</label>
|
||||
{{else}}
|
||||
<label for="system.points_de_tache">Points de tâches nécessaires</label>
|
||||
<input class="attribute-value" type="text" name="system.points_de_tache" value="{{system.points_de_tache}}" data-dtype="Number"/>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<hr>
|
||||
<div class="form-group">
|
||||
<label for="xp">Points de tâches obtenus</label>
|
||||
<label for="system.points_de_tache_courant">Points de tâches obtenus</label>
|
||||
<input class="attribute-value" type="text" name="system.points_de_tache_courant" value="{{system.points_de_tache_courant}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Nombre de Succès</label>
|
||||
<label for="system.nb_jet_succes">Nombre de Succès</label>
|
||||
<input class="attribute-value" type="text" name="system.nb_jet_succes" value="{{system.nb_jet_succes}}" data-dtype="Number" {{#if options.isGM}}{{else}}disabled{{/if}}/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Nombre d'Echecs</label>
|
||||
<label for="system.nb_jet_echec">Nombre d'Echecs</label>
|
||||
<input class="attribute-value" type="text" name="system.nb_jet_echec" value="{{system.nb_jet_echec}}" data-dtype="Number" {{#if options.isGM}}{{else}}disabled{{/if}}/>
|
||||
</div>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<div class="table-ajustement">
|
||||
<span class="tooltip tooltip-dotted">
|
||||
<span>Ajustement Final:</span>
|
||||
<span class="roll-param-resolution">{{selectedCarac.value}} / {{numberFormat finalLevel decimals=0 sign=true}}</span>
|
||||
<span class="roll-param-resolution">{{selectedCarac.value}} / {{plusMoins finalLevel}}</span>
|
||||
<div class="tooltiptext ttt-ajustements">
|
||||
{{#each ajustements as |item key|}}
|
||||
{{#if item.used}}
|
||||
@ -9,7 +9,7 @@
|
||||
{{#if item.descr}}
|
||||
{{{item.descr}}}
|
||||
{{else}}
|
||||
{{item.label}}: {{numberFormat item.value decimals=0 sign=true}}
|
||||
{{item.label}}: {{plusMoins item.value}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -2,8 +2,8 @@
|
||||
<label for="diffConditions">Conditions</label>
|
||||
<select name="diffConditions" data-dtype="number" {{#unless use.conditions}}disabled{{/unless}}>
|
||||
{{#select diffConditions}}
|
||||
{{#each ajustementsConditions as |key|}}
|
||||
<option value={{key}}>{{numberFormat key decimals=0 sign=true}}</option>
|
||||
{{#each ajustementsConditions as |key|}}
|
||||
<option value={{key}}>{{plusMoins key}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<div class="flexrow">
|
||||
<label>Difficulté imposée</label>
|
||||
<label>{{numberFormat diffLibre decimals=0 sign=true}}</label>
|
||||
<label>{{plusMoins diffLibre}}</label>
|
||||
</div>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<select name="diffLibre" data-dtype="number" {{#unless use.libre}}disabled{{/unless}}>
|
||||
{{#select diffLibre}}
|
||||
{{#each difficultesLibres as |key|}}
|
||||
<option value={{key}}>{{numberFormat key decimals=0 sign=true}}</option>
|
||||
<option value={{key}}>{{plusMoins key}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<th class="table-resolution-level">...</th>
|
||||
{{/if}}
|
||||
{{#each cols as |col|}}
|
||||
<th class="table-resolution-level">{{numberFormat col decimals=0 sign=true}}</th>
|
||||
<th class="table-resolution-level">{{plusMoins col}}</th>
|
||||
{{/each}}
|
||||
</tr>
|
||||
{{#each rows as |row|}}
|
||||
|
@ -5,7 +5,7 @@
|
||||
</strong> sur {{rolled.score}}%
|
||||
{{#if (and rolled.caracValue rolled.finalLevel)}}
|
||||
({{#if (gt rolled.diviseurSignificative 1)}}1/{{rolled.diviseurSignificative}}{{/if}}
|
||||
de {{rolled.caracValue}} à {{numberFormat rolled.finalLevel decimals=0 sign=true}})
|
||||
de {{rolled.caracValue}} à {{plusMoins rolled.finalLevel}})
|
||||
{{/if}}
|
||||
<strong>{{rolled.quality}}</strong>
|
||||
</p>
|
||||
|
@ -7,8 +7,8 @@
|
||||
{{else}}
|
||||
<input class="resource-content select-effect" type="checkbox" name="{{effect.id}}" {{#if effect.active}}checked{{/if}}/>
|
||||
{{/if}}
|
||||
<img class="button-effect-img" height="16" width="16" src="{{effect.icon}}" alt="{{localize effect.label}}" />
|
||||
<label>{{localize effect.label}}</label>
|
||||
<img class="button-effect-img" height="16" width="16" src="{{effect.icon}}" alt="{{localize effect.name}}" />
|
||||
<label>{{localize effect.name}}</label>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
@ -43,7 +43,7 @@
|
||||
{{#each ajustementActeur.ajustements as |ajustement|}}
|
||||
<td>{{#if (ne ajustement.ajustement 0)}}
|
||||
<strong>
|
||||
{{numberFormat ajustement.ajustement decimals=0 sign=true}}
|
||||
{{plusMoins ajustement.ajustement}}
|
||||
</strong>
|
||||
{{else}}
|
||||
<div class="dimmed">
|
||||
|
Reference in New Issue
Block a user