Compare commits

..

10 Commits

Author SHA1 Message Date
54785f0c3a Version 12.0.42 2025-02-10 01:54:25 +01:00
df76c4bd78 Corrections automatisations combat
Visiblement des changements sur les callbacks n'avaient pas
été finalisés
2025-02-10 01:54:25 +01:00
5f3c678195 Fix: jet de caractéristique/difficulté
Les jets avec difficulté ne fonctionnaient plus à cause des armes
 à 1 main / à 2 mains
2025-02-09 22:51:06 +01:00
89bbe63340 Merge pull request 'La loupe d'Astrobazzar' (#748) from VincentVk/foundryvtt-reve-de-dragon:v11 into v11
All checks were successful
Release Creation / build (release) Successful in 1m27s
Reviewed-on: #748
2025-02-09 00:30:52 +01:00
149990e352 Correction: diminution stress transformé 2025-02-07 21:29:50 +01:00
3e355784c7 Message d'expérience en sort
Adaptation du message d'xp en sort au renommage des voies draconiques
2025-02-07 20:47:20 +01:00
b92055d5dd Commande /tirer cachée
Pour les messages sans actor, la méthode getOwners ne marchait
pas. En cas d'absence d'acteur, les gmroll doivent être pour le
joueur courant et les MJs
2025-02-07 20:47:20 +01:00
220f8142f5 Merge pull request 'v11 Fix choix particulière' (#746) from VincentVk/foundryvtt-reve-de-dragon:v11 into v11
All checks were successful
Release Creation / build (release) Successful in 1m45s
Reviewed-on: #746
2025-02-06 10:42:25 +01:00
a8bb00ad0b Fix choix particulière 2025-02-05 22:56:24 +01:00
78e30b5503 Correction message min/max de race 2025-02-02 00:06:38 +01:00
180 changed files with 3354 additions and 5905 deletions

View File

@ -1,6 +1,6 @@
name: Release Creation name: Release Creation
on: on:
release: release:
types: [published] types: [published]
@ -9,11 +9,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- run: echo "💡 The ${{ gitea.repository }} repository will cloned to the runner." - run: echo "💡 The ${{ gitea.repository }} repository will cloned to the runner."
#- uses: actions/checkout@v3 #- uses: actions/checkout@v3
- uses: RouxAntoine/checkout@v3.5.4 - uses: RouxAntoine/checkout@v3.5.4
with:
ref: 'v13'
# get part of the tag after the `v` # get part of the tag after the `v`
- name: Extract tag version number - name: Extract tag version number
@ -31,7 +29,7 @@ jobs:
url: https://www.uberwald.me/gitea/${{gitea.repository}} url: https://www.uberwald.me/gitea/${{gitea.repository}}
manifest: https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/system.json manifest: https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/system.json
download: https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/rddsystem.zip download: https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/rddsystem.zip
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v2 uses: actions/setup-node@v2
with: with:
@ -39,7 +37,7 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: npm install run: npm install
- name: Build the compendiums - name: Build the compendiums
run: node ./tools/packCompendiumsToDist.mjs run: node ./tools/packCompendiumsToDist.mjs
@ -48,29 +46,29 @@ jobs:
apt update -y apt update -y
apt install -y zip apt install -y zip
- run: zip -r ./rddsystem.zip system.json template.json README.md LICENSE.txt assets/ css/ fonts/ icons lang/ module/ packs/ pic/ sounds/ styles/ templates/ - run: zip -r ./rddsystem.zip system.json template.json README.md LICENSE.txt assets/ fonts/ icons lang/ module/ packs/ pic/ sounds/ styles/ templates/
- name: setup go - name: setup go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: '>=1.20.1' go-version: '>=1.20.1'
- name: Use Go Action - name: Use Go Action
id: use-go-action id: use-go-action
uses: https://gitea.com/actions/release-action@main uses: https://gitea.com/actions/release-action@main
with: with:
files: |- files: |-
./rddsystem.zip ./rddsystem.zip
system.json system.json
api_key: '${{secrets.ALLOW_PUSH_RELEASE}}' api_key: '${{secrets.ALLOW_PUSH_RELEASE}}'
#- name: Publish to Foundry server - name: Publish to Foundry server
# uses: djlechuck/foundryvtt-publish-package-action@v1 uses: djlechuck/foundryvtt-publish-package-action@v1
# with: with:
# token: ${{ secrets.FOUNDRYVTT_RELEASE_TOKEN }} token: ${{ secrets.FOUNDRYVTT_RELEASE_TOKEN }}
# id: 'foundryvtt-reve-de-dragon' id: 'foundryvtt-reve-de-dragon'
# version: ${{github.event.release.tag_name}} version: ${{github.event.release.tag_name}}
# manifest: 'https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/system.json' manifest: 'https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/system.json'
# notes: 'https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v13/changelog.md' notes: 'https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md'
# compatibility-minimum: '13' compatibility-minimum: '12'
# compatibility-verified: '13' compatibility-verified: '12'

0
.gitlab/.gitkeep Normal file
View File

View File

View File

@ -0,0 +1,14 @@
Pour que le bug soit traité, merci de préciser quelques détails.
### Environment
> Indiquez quelques éléments de votre installation
* Foundry VTT Version: (Example 0.5.4)
* OS: [Windows, MacOS, Linux (which distro)]
* Modules ?: Liste des modules utilisés
### Description du problème
/label ~Bug ~Nonrepro

View File

@ -0,0 +1,14 @@
### Résumé de la fonctionnalité
> Décrivez de manière simple et concise la fonction que vous voulez voir ajoutée.
### Expérience Utilisateur
> Indiquez ce que l'utilisateur aura comme bénéfice avec cette fonction.
### Priority/Importance
> Selon vous, quelle est l'importance de cette fonctionnalité.
/label ~Feature

View File

@ -1,55 +1,5 @@
# 13.0
## 13.0.0 - Le début de l'errance d'Illysis
- Migration vers la version 13 de Foundry
# 12.0 # 12.0
## 12.0.50 - Le sommeil d'Astrobazzarh
- Le don de double rêve n'interrompt plus le sommeil toutes les heures
- la perte de fatigue à la descente des TMR est visible immédiatement
## 12.0.49 - La deuxième lame d'Astrobazzarh
- Corrections
- les défenses particulières sont correctement affichées
- les vieux boucliers (sans catégorie de parade car créés il y a longtemps) peuvent parer...
- Les attaques à distance n'ont pas de difficulté libre
## 12.0.48 - La chèvre d'Astrobazzarh
- le Bandersnatch a une protection de 10
- la consistance chèvre est maintenant possible dans les recettes
alchimiques (et toutes les consistances avec accents)
- un échec au lancement d'un sort pour le mettre en réserve brise
la concentration du haut-rêvant
- Correction: les réussites particulières fonctionnent avec les caractéristiques dérivées
## 12.0.47
- Correction sur les mise à jour en cascade -
- Correction sur le force rendering après un changement de competence
## 12.0.46 - Le double demi d'Astrobazzarh
- correction des raffraîchissement lors du sommeil qui empêchait de dormir
plusieurs heures
- Si la fatigue n'est pas utilisée, les rounds dans les TMR font perdre de l'endurance (au lieu d'en gagner)
- les TMRs se ferment correctement quand la fatigue maximale est dépassée
- le message de lancement de sort en réserve donne la description du sort
- suppression de double-messages lors de la fermeture des TMR
## 12.0.45 - Les errements d'Astrobazzarh, encore
- La difficulté des méditations n'augmente plus en cas de réussite et d'échec normal
- Renommage du Bouton pour révéler/masquer le demi-rêve
## 12.0.44 - Les errements d'Astrobazzarh, suite
- on peut de nouveau dormir et se réveiller reposé
- les possessions utilisent maintenant correctement le rêve actuel
- les sorts variables ne causent plus de soucis de voie pour le lancement de sorts
- les acteurs ayant un sort avec un coût de rêve entier ne sont plus considérés
comme pouvant avoir un rêve variable
## 12.0.42 - Les errements d'Astrobazzarh ## 12.0.42 - Les errements d'Astrobazzarh
- Correction de différentes automatisations de combat incorrectes - Correction de différentes automatisations de combat incorrectes
- Correction des jets `@roll[vue/-2]` qui tentaient de chercher une compétence -2 (à cause des armes à 1/2 mains) - Correction des jets `@roll[vue/-2]` qui tentaient de chercher une compétence -2 (à cause des armes à 1/2 mains)
@ -101,8 +51,8 @@
- support de liens "jets de dés" - support de liens "jets de dés"
- on peut ajouter des liens "jet de dés" dans les journaux, descriptions, notes, maladresses, ... - on peut ajouter des liens "jet de dés" dans les journaux, descriptions, notes, maladresses, ...
- avec la syntaxe `@roll[...]` on peut ajouter le lien vers: - avec la syntaxe `@roll[...]` on peut ajouter le lien vers:
- un jet de caractéristique/compétence `@roll[carac/competence/difficulte]` / `@roll[carac/difficulte]` / `@roll[carac/competence]` - un jet de caractéristique/compétence `@roll[carac/competence/difficulte]` / `@roll[carac/difficulte]` / `@roll[carac/competence]`
- une formule foundry `@roll[2d6]` pour lancer 2d6 - une formule foundry `@roll[2d6]` pour lancer 2d6
- une manipulation alchimique `@roll[couleur vert-bleu]` - une manipulation alchimique `@roll[couleur vert-bleu]`
- les liens "jet avec caractéristiques" s'appliquent: - les liens "jet avec caractéristiques" s'appliquent:
- à tous les tokens sélectionnés - à tous les tokens sélectionnés
@ -167,7 +117,7 @@
- les tas dans les conteneurs peuvent être désempilés sans rendre le conteneur inutilisable - les tas dans les conteneurs peuvent être désempilés sans rendre le conteneur inutilisable
- les conteneurs ne peuvent plus être empilés (pour éviter que le contenu de Schroedinger quand on les sépare) - les conteneurs ne peuvent plus être empilés (pour éviter que le contenu de Schroedinger quand on les sépare)
- on peut maintenant saisir et supprimer les bonus de cases de manière intuitive - on peut maintenant saisir et supprimer les bonus de cases de manière intuitive
## 12.0.23 - La bibliothèque d'Astrobazzarh ## 12.0.23 - La bibliothèque d'Astrobazzarh
- corrections mineures - corrections mineures
- meilleure gestion de la parade des armes naturelles - meilleure gestion de la parade des armes naturelles
@ -278,7 +228,7 @@
## 12.0.6 - Le bazar d'Astrobazzarh ## 12.0.6 - Le bazar d'Astrobazzarh
- Corrections de l'inventaire en bazar: - Corrections de l'inventaire en bazar:
- un problème pouvait survenir en déplaçant les objets - un problème pouvait survenir en déplaçant les objets
l'inventaire, qui fait qu'un conteneur se retrouve récursivement dans son l'inventaire, qui fait qu'un conteneur se retrouve récursivement dans son
propre contenu, ce qui empêche d'ouvrir la feuille d'acteur. propre contenu, ce qui empêche d'ouvrir la feuille d'acteur.
- un objet non-conteneur pouvait dans certains cas avoir un pseudo contenu - un objet non-conteneur pouvait dans certains cas avoir un pseudo contenu
@ -286,7 +236,7 @@
conteneur (et donc non affiché) conteneur (et donc non affiché)
- vider les conteneurs supprime correctement toutes les informations liées - vider les conteneurs supprime correctement toutes les informations liées
aux conteneurs/contenus aux conteneurs/contenus
- Les messages pour les tirages dans le compendium utilisent le "roll mode" - Les messages pour les tirages dans le compendium utilisent le "roll mode"
courant pour leur visibilité courant pour leur visibilité
- Fix: restaurer la compatibilité Foundry 11 - Fix: restaurer la compatibilité Foundry 11
@ -381,7 +331,7 @@
## 11.2.9 - La barbe d'Akarlikarlikar ## 11.2.9 - La barbe d'Akarlikarlikar
- Amélioration des textes de tooltips - Amélioration des textes de tooltips
- Les tooltips sont plus dans le thème de couleur du système Rêve de Dragon - Les tooltips sont plus dans le thème de couleur du système Rêve de Dragon
- Ajouts d'icones pour les attaque/initiative/soins dans les raccourcis sur les tokens (HUD) - Ajouts d'icones pour les attaque/initiative/soins dans les raccourcis sur les tokens (HUD)
- Ajout d'une icône et transformation en bouton du lien pour accéder à l'astrologie et aux chiffres astraux - Ajout d'une icône et transformation en bouton du lien pour accéder à l'astrologie et aux chiffres astraux
- Suppression de message de log inutile sur chaque point de coeur - Suppression de message de log inutile sur chaque point de coeur
@ -501,7 +451,7 @@ Vu qu'elles ne peuvent pas être utilisées, permet de savoir pourquoi
- le message annonçant le joueur dont c'est le tour ne contient plus d'informations de santé - 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 - 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 - le jet de vie est bien fait par le token si besoin
- seul les propriétaires peuvent faire les jets de vie - seul les propriétaires peuvent faire les jets de vie
- Amélioration de la fenêtre de jets - Amélioration de la fenêtre de jets
- le type de dégâts pour les attaques est toujours affiché - le type de dégâts pour les attaques est toujours affiché
- le moral est indiqué avant l'icone d'appel au moral - le moral est indiqué avant l'icone d'appel au moral
@ -608,3 +558,4 @@ Vu qu'elles ne peuvent pas être utilisées, permet de savoir pourquoi
- correction des achats par le MJ sans acteur sélectionné - correction des achats par le MJ sans acteur sélectionné
Cf branche v10 pour l'historique des versions 10 Cf branche v10 pour l'historique des versions 10

File diff suppressed because it is too large Load Diff

View File

@ -1,37 +0,0 @@
const gulp = require('gulp');
const less = require('gulp-less');
function onError(err) {
util.log(util.colors.red.bold('[ERROR LESS]:'),util.colors.bgRed(err.message));
this.emit('end');
};
/* ----------------------------------------- */
/* Compile LESS
/* ----------------------------------------- */
function compileLESS() {
return gulp.src("less/foundryvtt-reve-de-dragon.less")
.pipe(less()).on('error',console.log.bind(console))
.pipe(gulp.dest("./css"))
}
const css = gulp.series(compileLESS);
/* ----------------------------------------- */
/* Watch Updates
/* ----------------------------------------- */
const SIMPLE_LESS = ["less/*.less", "less/item/*.less"];
function watchUpdates() {
gulp.watch(SIMPLE_LESS, css);
}
/* ----------------------------------------- */
/* Export Tasks
/* ----------------------------------------- */
exports.default = gulp.series(
gulp.parallel(css),
watchUpdates
);
exports.css = css;
exports.watchUpdates = watchUpdates;

View File

@ -1,50 +0,0 @@
:root {
/* =================== 2. DEBUGGING HIGHLIGHTERS ============ */
// --debug-background-color-red: #ff000054;
// --debug-background-color-blue: #1d00ff54;
// --debug-background-color-green: #54ff0054;
// --debug-box-shadow-red: inset 0 0 2px red;
// --debug-box-shadow-blue: inset 0 0 2px blue;
// --debug-box-shadow-green: inset 0 0 2px green;
/* =================== 3. some constants ============ */
--fieldset-background: url(/ui/parchment.jpg);
--rdd-color-text-primary: rgba(10, 10, 10, 0.9);
--rdd-input-background:rgba(0, 0, 0, 0.05);
--rdd-color-border-input: rgba(0, 0, 0, 0.2);
--rdd-bg-input: rgba(255, 255, 255, 0.1);
--color-controls:rgba(0, 0, 0, 0.9);
--color-controls-light:hsla(0, 0%, 20%, 0.8);
--color-controls-hover:hsla(60, 100%, 75%, 0.7);
--color-control-border-hover:rgba(255, 128, 0, 0.8);
--color-gold: rgba(191, 149, 63, 0.8);
--gradient-gold: linear-gradient(30deg, rgba(191, 149, 63, 0.3), rgba(252, 246, 186, 0.3), rgba(179, 135, 40, 0.3), rgba(251, 245, 183, 0.3), rgba(170, 119, 28, 0.3));
--gradient-silver: linear-gradient(30deg, rgba(61, 55, 93, 0.3), rgba(178, 179, 196, 0.3), rgba(59, 62, 63, 0.6), rgba(206, 204, 199, 0.3), rgba(61, 46, 49, 0.3));
--gradient-green: linear-gradient(30deg, rgba(7, 76, 0, 0.3), rgba(66, 163, 65, 0.2), rgba(184, 226, 163, 0.1), rgba(66, 163, 65, 0.2), rgba(184, 226, 163, 0.3));
--gradient-red: linear-gradient(150deg, rgba(255, 0, 0, 0.3), rgba(255, 200, 128, 0.05),rgba(255, 200, 128, 0.1), rgba(255,10,0,0.3));
--gradient-violet: linear-gradient(150deg, rgba(100, 45, 124, 0.6), rgba(216, 157, 192, 0.3), rgba(177, 157, 216, 0.5), rgba(107, 62, 121, 0.3), rgba(100, 45, 124, 0.6));
--gradient-purple-black: linear-gradient(150deg, rgba(0, 0, 0, 0.7), rgba(100, 45, 124, 0.4), rgba(82, 17, 131, 0.3),rgba(100, 45, 124, 0.4), rgba(0, 0, 0, 0.7));
--gradient-silver-light: linear-gradient(30deg, rgba(61, 55, 93, 0.2), rgba(178, 179, 196, 0.1), rgba(59, 62, 63, 0.2), rgba(206, 204, 199, 0.1), rgba(61, 46, 49, 0.2));
--gradient-daylight: conic-gradient(
from 0deg,
hsla(50, 100%, 80%, 0.7),
hsla(30, 30%, 40%, 0.1) 25%,
hsla(250, 50%, 40%, 0.1) 25%,
hsla(250, 30%, 30%, 0.7) 50%,
hsla(250, 50%, 40%, 0.1) 75%,
hsla(30, 30%, 40%, 0.1) 75%,
hsla(50, 100%, 80%, 0.7)
);
--background-custom-button: linear-gradient(to bottom, rgba(33, 55, 74, 0.988) 5%, rgba(21, 40, 51, 0.671) 100%);
--background-custom-button-hover: linear-gradient(to bottom, rgb(128, 0, 0) 5%, rgb(62, 1, 1) 100%);
--background-control-selected: linear-gradient(to bottom, hsla(0, 100%, 25%, 0.5) 5%, hsla(0, 100%, 12%, 0.5) 100%);
--background-tooltip: hsla(60, 12%, 85%, 0.95);
--color-tooltip:hsla(282, 47%, 33%, 0.9);
--color-tooltip-faint:hsla(282, 47%, 66%, 0.5);
--background-error:hsla(16, 100%, 50%, 0.8);
--color-profile-border: hsla(0, 0%, 80%, 0.05);
}

View File

@ -1,84 +0,0 @@
/* ==================== (A) Fonts ==================== */
@font-face {
font-family: "GoudyAcc";
src: url('../fonts/goudyacc.ttf') format("truetype");
}
@font-face {
font-family: "MedievalSharp";
src: url('../fonts/MedievalSharp.ttf') format("truetype");
}
@font-face {
font-family: "GrenzeGotisch";
src: url('../fonts/GrenzeGotisch-Regular.ttf') format("truetype");
}
@font-face {
font-family: "Fondamento";
src: url('../fonts/Fondamento.ttf') format("truetype");
}
@font-face {
font-family: "CaslonAntique";
src: url('../fonts/CaslonAntique.ttf') format("truetype");
}
@font-face {
font-family: 'HeuresDraconiques';
src:
url('../fonts/heuresdraconiques2.woff') format('woff'),
url('../fonts/heuresdraconiques2.woff2') format('woff2'),
url('../fonts/heuresdraconiques2.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
:root {
/* =================== 1. ACTOR SHEET FONT STYLES =========== */
--window-header-title-font-family: CaslonAntique;
--window-header-title-font-size: 1.6rem;
--window-header-title-font-weight: normal;
--window-header-title-color: #f5f5f5;
--major-button-font-family: CaslonAntique;
--major-button-font-size: 1.4rem;
--major-button-font-weight: normal;
--major-button-color: #dadada;
--tab-header-font-family: CaslonAntique;
--tab-header-font-size: 1.2rem;
--tab-header-font-weight: 700;
--tab-header-color: #403f3e;
--tab-header-color-active: #4a0404;
--actor-input-font-family: CaslonAntique;
--actor-input-font-size: 1.2rem;
--actor-input-font-weight: 500;
--actor-input-color: black;
--actor-label-font-family: CaslonAntique;
--actor-label-font-size: 1.2rem;
--actor-label-font-weight: 700;
--actor-label-color: #464331c4;
}
/* Global styles & Font */
.window-app {
font-family: CaslonAntique;
text-align: justify;
font-size: 1rem;
letter-spacing: 1px;
}
/* Fonts */
.sheet header.sheet-header h1 input,
.window-app .window-header,
#actors .directory-list,
#navigation #scene-list .scene.nav-item {
font-family: "GoudyAcc"
}
/* For title, sidebar character and scene */
.sheet nav.sheet-tabs,
.window-app input,
.sheet header.sheet-header .header-compteurs,
.sheet header.sheet-header .flex-group-center.flex-fatigue,
select, .item-checkbox, #sidebar, #players, #navigation #nav-toggle {
font-family: "CaslonAntique"; /* For sheet parts; For nav and title */
}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +0,0 @@
// Styles pour la feuille d'objet Monnaie
.monnaie-content {
.item-sheet-common();
.item-sheet-header();
}

View File

@ -1,7 +0,0 @@
// Styles pour la feuille d'objet Monnaie
.munition-content {
.item-sheet-common();
.item-sheet-header();
}

View File

@ -1,7 +0,0 @@
// Styles pour la feuille d'objet Monnaie
.tarot-content {
.item-sheet-common();
.item-sheet-header();
}

View File

@ -1,108 +0,0 @@
.item-sheet-common() {
padding: 0px;
// Styles pour la section de description, si le partiel utilise une structure standard
.editor,
.editor-content {
height: auto; // Ajuster selon le besoin
min-height: 100px; // Hauteur minimale pour la description
background: var(--rdd-bg-input-alt); // Une couleur de fond alternative
padding: 5px;
border-radius: 3px;
color: var(--rdd-color-text-primary);
}
.window-content {
font-family: CaslonAntique;
text-align: justify;
font-size: 1rem;
letter-spacing: 1px;
padding: 0% 0 0 0;
font-size: calc(var(--font-size-standard) * 1);
color: var(--color-dark-1);
background-size: 100% 100%;
}
fieldset {
background: var(--fieldset-background);
color: var(--rdd-color-text-primary);
margin-bottom: 4px;
border-radius: 6px;
border-color: var(--rdd-color-text-primary);
border-width: 2px;
}
.form-group {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
align-items: center;
padding: 2px 0;
border-bottom: 1px solid var(--rdd-color-shadow-primary);
font-size: 0.9rem;
label {
font-weight: normal;
flex: 2;
padding-left: 5px;
margin: 0;
color: var(
--rdd-color-text-primary
); // Assurez-vous que cette variable existe dans colors.less
}
.attribute-value,
input[type="text"],
input[type="number"],
select {
flex: 3;
background: var(--rdd-input-background);
border: 1px solid var(--rdd-color-border-input); // Assurez-vous que cette variable existe
color: var(
--rdd-color-text-input
); // Assurez-vous que cette variable existe
padding: 2px 2px; // Augmentation du padding vertical
border-radius: 3px;
}
input[type="checkbox"] {
flex: 0 0 20px; // Taille fixe pour les cases à cocher
margin-left: 5px;
}
}
}
.item-sheet-header() {
background: #011d33 url(../assets/ui/bg_header.webp) no-repeat left top;
color: rgba(255, 255, 255, 1);
.sheet-header-row {
display: flex;
flex-direction: row;
align-items: center;
h1,
input {
font-family: CaslonAntique;
font-size: 2.5rem;
font-weight: normal;
color: var(--window-header-title-color);
margin: 4px;
height: 3rem;
}
}
:is(
input[type="text"],
input[type="number"],
input[type="password"],
input[type="datetime-local"],
input[type="date"],
input[type="time"]
) {
color: rgba(255, 255, 255, 0.75);
background: rgba(255, 255, 255, 0.1);
border: 0 none;
margin-bottom: 0.2rem;
}
}

View File

@ -243,7 +243,7 @@ export class RdDActor extends RdDBaseActorSang {
} }
await this.resetInfoSommeil() await this.resetInfoSommeil()
ChatMessage.create(message); ChatMessage.create(message);
setTimeout(() => this.sheet.render(), 20) this.sheet.render(true);
} }
async _recuperationSante(message) { async _recuperationSante(message) {
@ -279,32 +279,28 @@ export class RdDActor extends RdDBaseActorSang {
/* -------------------------------------------- */ /* -------------------------------------------- */
async dormirChateauDormant() { async dormirChateauDormant() {
if (!ReglesOptionnelles.isUsing("chateau-dormant-gardien") || !this.system.sommeil || this.system.sommeil.nouveaujour) { if (!ReglesOptionnelles.isUsing("chateau-dormant-gardien") || !this.system.sommeil || this.system.sommeil.nouveaujour) {
await this.$dormirChateauDormant(); const message = {
setTimeout(() => this.sheet.render(), 20) whisper: ChatUtility.getOwners(this),
} content: ""
} };
async $dormirChateauDormant() { await this._recuperationSante(message)
const message = { await this._recupereMoralChateauDormant(message)
whisper: ChatUtility.getOwners(this), await this._recupereChance()
content: "" await this.transformerStress()
}; await this.retourSeuilDeReve(message)
await this.setBonusPotionSoin(0)
await this._recuperationSante(message); await this.retourSust(message)
await this._recupereMoralChateauDormant(message); await this.$perteReveEnchantementsChateauDormants()
await this._recupereChance(); await this.$suppressionLancementsSort()
await this.transformerStress(); await RdDCoeur.applyCoeurChateauDormant(this, message)
await this.retourSeuilDeReve(message); if (message.content != "") {
await this.setBonusPotionSoin(0); message.content = `A la fin Chateau Dormant, ${message.content}<br>Un nouveau jour se lève`;
await this.retourSust(message); ChatMessage.create(message);
await this.$perteReveEnchantementsChateauDormants(); }
await this.$suppressionLancementsSort(); await this.resetInfoSommeil();
await RdDCoeur.applyCoeurChateauDormant(this, message); this.sheet.render(true);
if (message.content != "") {
message.content = `A la fin Chateau Dormant, ${message.content}<br>Un nouveau jour se lève`;
ChatMessage.create(message);
} }
await this.resetInfoSommeil();
} }
async resetInfoSommeil() { async resetInfoSommeil() {
@ -446,9 +442,10 @@ export class RdDActor extends RdDBaseActorSang {
message.content += 'Vous ne trouvez pas le sommeil'; message.content += 'Vous ne trouvez pas le sommeil';
} }
else { else {
let dormi = await this.$dormirDesHeures(message, heures, options); let jetsReve = [];
if (dormi.jetsReve.length > 0) { let dormi = await this.dormirDesHeures(jetsReve, message, heures, options);
message.content += `Vous récupérez ${dormi.jetsReve.map(it => it < 0 ? '0 (réveil)' : it).reduce(Misc.joining("+"))} Points de rêve. `; if (jetsReve.length > 0) {
message.content += `Vous récupérez ${jetsReve.map(it => it < 0 ? '0 (réveil)' : it).reduce(Misc.joining("+"))} Points de rêve. `;
} }
if (dormi.etat == 'eveil') { if (dormi.etat == 'eveil') {
await this.reveilReveDeDragon(message, dormi.heures); await this.reveilReveDeDragon(message, dormi.heures);
@ -461,9 +458,11 @@ export class RdDActor extends RdDBaseActorSang {
ChatMessage.create(message); ChatMessage.create(message);
} }
if (options.chateauDormant) { if (options.chateauDormant) {
await this.$dormirChateauDormant(); await this.dormirChateauDormant();
}
else {
this.sheet.render(true);
} }
setTimeout(() => this.sheet.render(), 20)
} }
async reveilReveDeDragon(message, heures) { async reveilReveDeDragon(message, heures) {
@ -473,18 +472,18 @@ export class RdDActor extends RdDBaseActorSang {
} }
} }
async $dormirDesHeures(message, heures, options) { async dormirDesHeures(jetsReve, message, heures, options) {
const dormi = { heures: 0, etat: 'dort', jetsReve: [] }; const dormi = { heures: 0, etat: 'dort' };
for (; dormi.heures < heures && dormi.etat == 'dort'; dormi.heures++) { for (; dormi.heures < heures && dormi.etat == 'dort'; dormi.heures++) {
await this.$recupererEthylisme(message); await this._recupererEthylisme(message);
if (options.grisReve) { if (options.grisReve) {
await this.$recupererFatigue(message); await this.recupererFatigue(message);
} }
else if (!this.system.sommeil?.insomnie) { else if (!this.system.sommeil?.insomnie) {
await this.$recupererFatigue(message); await this.recupererFatigue(message);
await this.$jetRecuperationReve(dormi, message); dormi.etat = await this.jetRecuperationReve(jetsReve, message);
if (dormi.etat == 'dort' && EffetsDraconiques.isDonDoubleReve(this)) { if (dormi.etat == 'dort' && EffetsDraconiques.isDonDoubleReve(this)) {
await this.$jetRecuperationReve(dormi, message); dormi.etat = await this.jetRecuperationReve(jetsReve, message);
} }
} }
} }
@ -492,36 +491,35 @@ export class RdDActor extends RdDBaseActorSang {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async $jetRecuperationReve(dormi, message) { async jetRecuperationReve(jetsReve, message) {
if (this.getReveActuel() < this.system.reve.seuil.value) { if (this.getReveActuel() < this.system.reve.seuil.value) {
const reve = await RdDDice.rollTotal("1dr") let reve = await RdDDice.rollTotal("1dr");
if (reve >= 7) { if (reve >= 7) {
// Rêve de Dragon ! // Rêve de Dragon !
message.content += `Vous faites un <strong>Rêve de Dragon</strong> de ${reve} Points de rêve qui vous réveille! `; message.content += `Vous faites un <strong>Rêve de Dragon</strong> de ${reve} Points de rêve qui vous réveille! `;
await this.combattreReveDeDragon(reve); await this.combattreReveDeDragon(reve);
dormi.jetsReve.push(-1); jetsReve.push(-1);
dormi.etat = 'eveil' return 'eveil';
return
} }
else { else {
if (!ReglesOptionnelles.isUsing("recuperation-reve")) { if (!ReglesOptionnelles.isUsing("recuperation-reve")) {
ChatMessage.create({ ChatMessage.create({
whisper: ChatUtility.getOwners(this), whisper: ChatUtility.getOwners(this),
content: `Pas de récupération de rêve (${reve} points ignorés)` content: `Pas de récupération de rêve (${reve} points ignorés)`
}) });
dormi.jetsReve.push(0) jetsReve.push(0);
} }
else { else {
await this.reveActuelIncDec(reve) await this.reveActuelIncDec(reve);
dormi.jetsReve.push(reve) jetsReve.push(reve);
} }
} }
} }
dormi.etat = 'dort' return 'dort';
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async $recupererEthylisme(message) { async _recupererEthylisme(message) {
if (!ReglesOptionnelles.isUsing("recuperation-ethylisme")) { return; } if (!ReglesOptionnelles.isUsing("recuperation-ethylisme")) { return; }
let value = Math.min(Number.parseInt(this.system.compteurs.ethylisme.value) + 1, 1); let value = Math.min(Number.parseInt(this.system.compteurs.ethylisme.value) + 1, 1);
if (value <= 0) { if (value <= 0) {
@ -543,6 +541,7 @@ export class RdDActor extends RdDBaseActorSang {
max = Math.floor(max / 2); max = Math.floor(max / 2);
} }
const manquant = max - this.system.sante.endurance.value; const manquant = max - this.system.sante.endurance.value;
if (manquant > 0) { if (manquant > 0) {
await this.santeIncDec("endurance", manquant); await this.santeIncDec("endurance", manquant);
message.content += `Vous récuperez ${manquant} points d'endurance. `; message.content += `Vous récuperez ${manquant} points d'endurance. `;
@ -550,15 +549,15 @@ export class RdDActor extends RdDBaseActorSang {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async $recupererFatigue(message) { async recupererFatigue(message) {
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) { if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
let fatigue = this.system.sante.fatigue.value let fatigue = this.system.sante.fatigue.value;
const fatigueMin = this.getFatigueMin() const fatigueMin = this.getFatigueMin();
if (fatigue <= fatigueMin) { if (fatigue <= fatigueMin) {
return return;
} }
fatigue = Math.max(fatigueMin, this._calculRecuperationSegment(fatigue)) fatigue = Math.max(fatigueMin, this._calculRecuperationSegment(fatigue));
await this.update({ 'system.sante.fatigue.value': fatigue }); await this.update({ "system.sante.fatigue.value": fatigue });
if (fatigue == 0) { if (fatigue == 0) {
message.content += "Vous êtes complêtement reposé. "; message.content += "Vous êtes complêtement reposé. ";
} }
@ -668,23 +667,19 @@ export class RdDActor extends RdDBaseActorSang {
if (!RdDItemRace.checkRacialMax(this, caracName, to)) { if (!RdDItemRace.checkRacialMax(this, caracName, to)) {
return return
} }
let updates = {};
if (caracName == LIST_CARAC_PERSONNAGE.reve.code) { if (caracName == LIST_CARAC_PERSONNAGE.reve.code) {
if (to > Misc.toInt(this.system.reve.seuil.value)) { if (to > Misc.toInt(this.system.reve.seuil.value)) {
updates[`system.reve.seuil.value`] = to; // SFA : Direct and packed changes this.setPointsDeSeuil(to);
//this.setPointsDeSeuil(to); }
}
} }
if (caracName == LIST_CARAC_PERSONNAGE.chance.code) { if (caracName == LIST_CARAC_PERSONNAGE.chance.code) {
if (to > Misc.toInt(this.system.compteurs.chance.value)) { if (to > Misc.toInt(this.system.compteurs.chance.value)) {
updates[`system.compteurs.chance.value`] = to; // SFA : Direct and packed changes this.setPointsDeChance(to);
//this.setPointsDeChance(to);
} }
} }
let selectedCarac = this.findCaracByName(caracName); let selectedCarac = this.findCaracByName(caracName);
const from = selectedCarac.value const from = selectedCarac.value
updates[`system.carac.${caracName}.value`] = to; await this.update({ [`system.carac.${caracName}.value`]: to });
await this.update(updates);
await ExperienceLog.add(this, XP_TOPIC.CARAC, from, to, caracName); await ExperienceLog.add(this, XP_TOPIC.CARAC, from, to, caracName);
} }
@ -788,7 +783,7 @@ export class RdDActor extends RdDBaseActorSang {
const toNiveau = compValue ?? RdDItemCompetence.getNiveauBase(competence.system.categorie, competence.getCategories()); const toNiveau = compValue ?? RdDItemCompetence.getNiveauBase(competence.system.categorie, competence.getCategories());
this.notifyCompetencesTronc(competence, toNiveau); this.notifyCompetencesTronc(competence, toNiveau);
const fromNiveau = competence.system.niveau; const fromNiveau = competence.system.niveau;
await competence.update({ 'system.niveau': toNiveau }, { render: true }) await competence.update({ 'system.niveau': toNiveau }, { render: false })
await ExperienceLog.add(this, XP_TOPIC.NIVEAU, fromNiveau, toNiveau, competence.name, true); await ExperienceLog.add(this, XP_TOPIC.NIVEAU, fromNiveau, toNiveau, competence.name, true);
} }
} }
@ -1052,10 +1047,20 @@ export class RdDActor extends RdDBaseActorSang {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async deleteRencontreTMRAtPosition() {
const rencontreIds = this.itemTypes[ITEM_TYPES.rencontre].filter(this.filterRencontreTMRDemiReve()).map(it => it.id)
if (rencontreIds.length > 0) {
await this.deleteEmbeddedDocuments('Item', rencontreIds)
}
}
getRencontreTMREnAttente() { getRencontreTMREnAttente() {
return this.itemTypes[ITEM_TYPES.rencontre].find(this.filterRencontreTMRDemiReve())
}
filterRencontreTMRDemiReve() {
const position = this.getDemiReve() const position = this.getDemiReve()
return this.itemTypes[ITEM_TYPES.rencontre].find(it => it.system.coord == position) return it => it.system.coord == position
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -1765,7 +1770,7 @@ export class RdDActor extends RdDBaseActorSang {
if (reveActuel == 0) { // 0 points de reve if (reveActuel == 0) { // 0 points de reve
ChatMessage.create({ content: this.name + " est réduit à 0 Points de Rêve, et tombe endormi !" }); ChatMessage.create({ content: this.name + " est réduit à 0 Points de Rêve, et tombe endormi !" });
} }
if (!rollData.isSortReserve || !rolled.isSuccess) { if (!rollData.isSortReserve) {
this.tmrApp?.close(); this.tmrApp?.close();
} }
} }
@ -2111,6 +2116,7 @@ export class RdDActor extends RdDBaseActorSang {
label: "Jet de méditation", label: "Jet de méditation",
callbacks: [ callbacks: [
this.createCallbackExperience(), this.createCallbackExperience(),
{ condition: r => r.rolled.isEPart, action: r => this._meditationEPart(r) },
{ action: r => this._meditationResult(r) } { action: r => this._meditationResult(r) }
] ]
}); });
@ -2119,16 +2125,21 @@ export class RdDActor extends RdDBaseActorSang {
/* -------------------------------------------- */ /* -------------------------------------------- */
async _meditationResult(meditationRoll) { async _meditationResult(meditationRoll) {
this.santeIncDec("fatigue", 2);
if (meditationRoll.rolled.isSuccess) { if (meditationRoll.rolled.isSuccess) {
await this.createEmbeddedDocuments("Item", [RdDItemSigneDraconique.prepareSigneDraconiqueMeditation(meditationRoll.meditation, meditationRoll.rolled)]); await this.createEmbeddedDocuments("Item", [RdDItemSigneDraconique.prepareSigneDraconiqueMeditation(meditationRoll.meditation, meditationRoll.rolled)]);
} }
if (meditationRoll.rolled.isEPart){
await this.updateEmbeddedDocuments('Item', [{ _id: meditationRoll.meditation._id, 'system.malus': meditationRoll.meditation.system.malus - 1 }]);
}
await this.santeIncDec("fatigue", 2);
await RdDRollResult.displayRollData(meditationRoll, this.name, 'chat-resultat-meditation.hbs'); await RdDRollResult.displayRollData(meditationRoll, this.name, 'chat-resultat-meditation.hbs');
} }
/* -------------------------------------------- */
_meditationEPart(meditationRoll) {
this.updateEmbeddedDocuments('Item', [{ _id: meditationRoll.meditation._id, 'system.malus': meditationRoll.meditation.system.malus - 1 }]);
}
/* -------------------------------------------- */ /* -------------------------------------------- */
_getSignesDraconiques(coord) { _getSignesDraconiques(coord) {
const type = TMRUtility.getTMRType(coord); const type = TMRUtility.getTMRType(coord);

View File

@ -39,12 +39,7 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
return 0; return 0;
} }
isCumulFatigueCauseSommeil(cumulFatigue){ getFatigueRestante() { return this.getFatigueMax() - this.getFatigueActuelle() }
return ReglesOptionnelles.isUsing("appliquer-fatigue")
? (this.getFatigueRestante() <= cumulFatigue)
: (this.getEnduranceActuelle() <= cumulFatigue)
}
getFatigueRestante() {return this.getFatigueMax() - this.getFatigueActuelle() }
getFatigueMin() { return this.system.sante.endurance.max - this.system.sante.endurance.value } getFatigueMin() { return this.system.sante.endurance.max - this.system.sante.endurance.value }
malusFatigue() { malusFatigue() {

View File

@ -14,12 +14,11 @@ import { ItemAction } from "../item/item-actions.js";
* Extend the basic ActorSheet with some very simple modifications * Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet} * @extends {ActorSheet}
*/ */
export class RdDBaseActorSheet extends foundry.appv1.sheets.ActorSheet { export class RdDBaseActorSheet extends ActorSheet {
static _warnedAppV1 = true
/** @override */ /** @override */
static get defaultOptions() { static get defaultOptions() {
return foundry.utils.mergeObject(foundry.appv1.sheets.ActorSheet.defaultOptions, { return foundry.utils.mergeObject(ActorSheet.defaultOptions, {
classes: ["rdd", "sheet", "actor"], classes: ["rdd", "sheet", "actor"],
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }], tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: undefined }], dragDrop: [{ dragSelector: ".item-list .item", dropSelector: undefined }],

View File

@ -734,7 +734,7 @@ export class RdDBaseActor extends Actor {
name: this.getAlias(), name: this.getAlias(),
system: { description: this.system.description } system: { description: this.system.description }
} }
foundry.applications.handlebars.renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.hbs', chatData) renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.hbs', chatData)
.then(html => ChatMessage.create(RdDUtility.chatDataSetup(html, modeOverride))); .then(html => ChatMessage.create(RdDUtility.chatDataSetup(html, modeOverride)));
} }

View File

@ -7,7 +7,7 @@ import { CATEGORIES_COMPETENCES, CATEGORIES_DRACONIC, Mapping } from "./mapping.
export class RdDActorExportSheet extends RdDActorSheet { export class RdDActorExportSheet extends RdDActorSheet {
static init() { static init() {
foundry.applications.handlebars.loadTemplates([ loadTemplates([
"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/arme.hbs", "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/arme.hbs",
"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/blessure.hbs", "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/blessure.hbs",
"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/blessures.hbs", "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/blessures.hbs",
@ -21,7 +21,7 @@ export class RdDActorExportSheet extends RdDActorSheet {
"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/protection.hbs", "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/protection.hbs",
"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/sort.hbs", "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/sort.hbs",
]) ])
foundry.documents.collections.Actors.registerSheet(SYSTEM_RDD, RdDActorExportSheet, { types: ["personnage"], makeDefault: false, label: "Feuille simplifiée" }) Actors.registerSheet(SYSTEM_RDD, RdDActorExportSheet, { types: ["personnage"], makeDefault: false, label: "Feuille simplifiée" })
} }
static get defaultOptions() { static get defaultOptions() {

View File

@ -3,7 +3,7 @@ import { Misc } from "../../misc.js"
import { EXPORT_CSV_SCRIPTARIUM, OptionsAvancees } from "../../settings/options-avancees.js" import { EXPORT_CSV_SCRIPTARIUM, OptionsAvancees } from "../../settings/options-avancees.js"
import { Mapping } from "./mapping.js" import { Mapping } from "./mapping.js"
const IMG_SCRIPTARIUM = '<img class="context-menu-img" src="systems/foundryvtt-reve-de-dragon/assets/ui/scriptarium.svg">' const IMG_SCRIPTARIUM = '<img class="context-menu-img" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/scriptarium.svg">'
export class ExportScriptarium { export class ExportScriptarium {

View File

@ -26,7 +26,7 @@ const RANDOM_VALUES = {
export class AppPersonnageAleatoire extends FormApplication { export class AppPersonnageAleatoire extends FormApplication {
static preloadHandlebars() { static preloadHandlebars() {
foundry.applications.handlebars.loadTemplates([ loadTemplates([
'systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs', 'systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs',
]) ])
} }

View File

@ -1,5 +0,0 @@
export { default as RdDItemBaseSheet} from "./common-item-sheet.mjs"
export { default as RdDMonnaieSheet } from "./monnaie-sheet.mjs"
export { default as RdDMunitionSheet } from "./munition-sheet.mjs"
export { default as RdDTarotSheet } from "./tarot-sheet.mjs"

View File

@ -1,111 +0,0 @@
const { HandlebarsApplicationMixin } = foundry.applications.api
import { SYSTEM_RDD } from "../../constants.js"
import { Misc } from "../../misc.js"
import { RdDSheetUtility } from "../../rdd-sheet-utility.js";
export default class RdDItemBaseSheet extends HandlebarsApplicationMixin(foundry.applications.sheets.ItemSheetV2) {
static preloadHandlebars(...templatesList) {
const handlebars = ["systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/header.hbs"]
templatesList.forEach(templates =>
templates.forEach(t =>
t.handlebars().forEach(h => handlebars.push(h))
)
)
loadTemplates(Misc.distinct(handlebars))
}
static register(sheetClass) {
const itemType = sheetClass.ITEM_TYPE
Items.registerSheet(SYSTEM_RDD, sheetClass, {
label: Misc.typeName('Item', itemType),
types: [itemType],
makeDefault: true
})
}
static registerAll(...sheetClasses) {
const handlebars = ["systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/header.hbs"]
sheetClasses.forEach(sheetClass => {
sheetClass.TEMPLATES.forEach(t =>
t.handlebars().forEach(h => handlebars.push(h))
)
const itemType = sheetClass.ITEM_TYPE
foundry.documents.collections.Items.registerSheet(SYSTEM_RDD, sheetClass, {
label: Misc.typeName('Item', itemType),
types: [itemType],
makeDefault: true
})
})
foundry.applications.handlebars.loadTemplates(Misc.distinct(handlebars))
}
static get ITEM_TYPE() { return undefined }
constructor(options = {}) {
super(options)
}
static get TEMPLATES() { return [] }
/** @override */
static DEFAULT_OPTIONS = {
classes: ["fvtt-rdd", "item"],
position: {
width: 448,
height: "auto",
},
form: {
submitOnChange: true,
},
window: {
resizable: true,
},
actions: {
editImage: RdDItemBaseSheet.#onEditImage,
}
}
/** @override */
async _prepareContext() {
return {
item: this.document,
options: RdDSheetUtility.getOptions(this.document, this.isEditable),
fields: this.document.schema.fields,
systemFields: this.document.system.schema.fields,
system: this.document.system,
source: this.document.toObject(),
isEditable: this.isEditable,
}
}
// #region Actions
/**
* Handle changing a Document's image.
*
* @this RdDItemBaseSheet
* @param {PointerEvent} event The originating click event
* @param {HTMLElement} target The capturing HTML element which defined a [data-action]
* @returns {Promise}
* @private
*/
static async #onEditImage(event, target) {
const attr = target.dataset.edit
const current = foundry.utils.getProperty(this.document, attr)
const { img } = this.document.constructor.getDefaultArtwork?.(this.document.toObject()) ?? {}
const fp = new FilePicker({
current,
type: "image",
redirectToRoot: img ? [img] : [],
callback: (path) => {
this.document.update({ [attr]: path })
},
top: this.position.top + 40,
left: this.position.left + 10,
})
return fp.browse()
}
// #endregion
}

View File

@ -1,35 +0,0 @@
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs";
import { ITEM_TYPES } from "../../constants.js";
import RdDItemBaseSheet from "./common-item-sheet.mjs";
export default class RdDMonnaieSheet extends RdDItemBaseSheet {
/** @override */
static get ITEM_TYPE() { return ITEM_TYPES.monnaie }
static get TEMPLATES() { return [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE] }
/** @override */
static DEFAULT_OPTIONS = Object.assign({},
RdDItemBaseSheet.DEFAULT_OPTIONS,
{
classes: ["fvtt-rdd", "item", "monnaie"],
position: { width: 448 },
window: { contentClasses: ["monnaie-content"] }
})
/** @override */
static PARTS = {
main: {
template: "systems/foundryvtt-reve-de-dragon/templates/sheets/item/monnaie.hbs",
},
}
/** @override */
async _prepareContext() {
return Object.assign(
await super._prepareContext(),
await TEMPLATE_DESCRIPTION.prepareContext(this.document),
await TEMPLATE_INVENTAIRE.prepareContext(this.document)
)
}
}

View File

@ -1,34 +0,0 @@
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs";
import { ITEM_TYPES } from "../../constants.js";
import RdDItemBaseSheet from "./common-item-sheet.mjs";
export default class RdDMunitionSheet extends RdDItemBaseSheet {
/** @override */
static get ITEM_TYPE() { return ITEM_TYPES.munition }
static get TEMPLATES() { return [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE] }
/** @override */
static DEFAULT_OPTIONS = Object.assign({},
RdDItemBaseSheet.DEFAULT_OPTIONS,
{
classes: ["fvtt-rdd", "item", "munition"],
position: { width: 448 },
window: { contentClasses: ["munition-content"] }
})
/** @override */
static PARTS = {
main: {
template: "systems/foundryvtt-reve-de-dragon/templates/sheets/item/munition.hbs",
},
}
/** @override */
async _prepareContext() {
return Object.assign(
await super._prepareContext(),
await TEMPLATE_DESCRIPTION.prepareContext(this.document),
await TEMPLATE_INVENTAIRE.prepareContext(this.document)
)
}
}

View File

@ -1,33 +0,0 @@
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs";
import { ITEM_TYPES } from "../../constants.js";
import RdDItemBaseSheet from "./common-item-sheet.mjs";
export default class RdDTarotSheet extends RdDItemBaseSheet {
/** @override */
static get ITEM_TYPE() { return ITEM_TYPES.tarot }
static get TEMPLATES() { return [TEMPLATE_DESCRIPTION] }
/** @override */
static DEFAULT_OPTIONS = Object.assign({},
RdDItemBaseSheet.DEFAULT_OPTIONS,
{
classes: ["fvtt-rdd", "item", "tarot"],
position: { width: 448 },
window: { contentClasses: ["tarot-content"] }
})
/** @override */
static PARTS = {
main: {
template: "systems/foundryvtt-reve-de-dragon/templates/sheets/item/tarot.hbs",
},
}
/** @override */
async _prepareContext() {
return Object.assign(
await super._prepareContext(),
await TEMPLATE_DESCRIPTION.prepareContext(this.document)
)
}
}

View File

@ -13,7 +13,7 @@ const TEXT_ROLL_MANAGERS = [
export class RdDTextEditor { export class RdDTextEditor {
static registerChatCallbacks(html) { static registerChatCallbacks(html) {
$(html).on("click", '.roll-text', async event => await RdDTextEditor.rollText(event)) html.on("click", '.roll-text', async event => await RdDTextEditor.rollText(event))
} }
static async enrichHTML(text, object, options = {showlink:true}) { static async enrichHTML(text, object, options = {showlink:true}) {
@ -30,7 +30,7 @@ export class RdDTextEditor {
context.text = await manager.onReplaceRoll(context); context.text = await manager.onReplaceRoll(context);
} }
return await foundry.applications.ux.TextEditor.implementation.enrichHTML(context.text, { return await TextEditor.enrichHTML(context.text, {
relativeTo: object, relativeTo: object,
secrets: object?.isOwner, secrets: object?.isOwner,
async: true async: true

View File

@ -5,7 +5,7 @@ import { RdDUtility } from "../../rdd-utility.js";
import { RdDAlchimie } from "../../rdd-alchimie.js"; import { RdDAlchimie } from "../../rdd-alchimie.js";
import { TextRollManager } from "./text-roll-formatter.js"; import { TextRollManager } from "./text-roll-formatter.js";
const REGEX_ALCHIMIE_TERMES = "(?<termes>([-A-Za-zÀ-ÖØ-öø-ÿ ])+)" const REGEX_ALCHIMIE_TERMES = "(?<termes>(\\w|-)+)"
const REGEX_ALCHIMIE_MANIP = "(?<manip>(couleur|consistance))" const REGEX_ALCHIMIE_MANIP = "(?<manip>(couleur|consistance))"
const XREGEXP_ROLL_ALCHIMIE = XRegExp("@roll\\[" + REGEX_ALCHIMIE_MANIP + "\\s+" + REGEX_ALCHIMIE_TERMES + "\\]", 'giu') const XREGEXP_ROLL_ALCHIMIE = XRegExp("@roll\\[" + REGEX_ALCHIMIE_MANIP + "\\s+" + REGEX_ALCHIMIE_TERMES + "\\]", 'giu')
const XREGEXP_ROLL_ALCHIMIE_MANIP = XRegExp("@" + REGEX_ALCHIMIE_MANIP + "\\{" + REGEX_ALCHIMIE_TERMES + "\\}", 'giu') const XREGEXP_ROLL_ALCHIMIE_MANIP = XRegExp("@" + REGEX_ALCHIMIE_MANIP + "\\{" + REGEX_ALCHIMIE_TERMES + "\\}", 'giu')

View File

@ -5,12 +5,12 @@ import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js";
/** /**
* Class providing helper methods to get the list of users, and * Class providing helper methods to get the list of users, and
*/ */
export class ChatUtility { export class ChatUtility {
static async init() { static async init() {
Hooks.on("renderChatMessageHTML", async (app, html, msg) => await ChatUtility.onRenderChatMessage(app, html, msg)) Hooks.on("renderChatMessage", async (app, html, msg) => await ChatUtility.onRenderChatMessage(app, html, msg))
Hooks.on("createChatMessage", async (chatMessage, options, id) => await ChatUtility.onCreateChatMessage(chatMessage, options, id)) Hooks.on("createChatMessage", async (chatMessage, options, id) => await ChatUtility.onCreateChatMessage(chatMessage, options, id))
} }
@ -190,8 +190,8 @@ export class ChatUtility {
if (rddTimestamp) { if (rddTimestamp) {
const timestamp = new RdDTimestamp(rddTimestamp); const timestamp = new RdDTimestamp(rddTimestamp);
const timestampData = timestamp.toCalendrier(); const timestampData = timestamp.toCalendrier();
const dateHeure = await foundry.applications.handlebars.renderTemplate('systems/foundryvtt-reve-de-dragon/templates/common/date-heure.hbs', timestampData); const dateHeure = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/common/date-heure.hbs', timestampData);
$(html).find('header.message-header .message-sender').after(dateHeure) html.find('header.message-header .message-sender').after(dateHeure)
} }
} }

View File

@ -5,13 +5,13 @@ const INFO_COEUR = 'info-coeur';
export class RdDCoeur { export class RdDCoeur {
static registerChatCallbacks(html) { static registerChatCallbacks(html) {
$(html).on("click", 'a.accepter-tendre-moment', event => { html.on("click", 'a.accepter-tendre-moment', event => {
RdDCoeur.accepterTendreMoment(RdDCoeur.extractInfoCoeur(event)) RdDCoeur.accepterTendreMoment(RdDCoeur.extractInfoCoeur(event))
}) })
$(html).on("click", 'a.refuser-tendre-moment', event => { html.on("click", 'a.refuser-tendre-moment', event => {
RdDCoeur.refuserTendreMoment(RdDCoeur.extractInfoCoeur(event)) RdDCoeur.refuserTendreMoment(RdDCoeur.extractInfoCoeur(event))
}) })
$(html).on("click", 'a.perdre-point-coeur-douceur', event => { html.on("click", 'a.perdre-point-coeur-douceur', event => {
RdDCoeur.perdreEnDouceur( RdDCoeur.perdreEnDouceur(
RdDCoeur.extractInfoCoeur(event), RdDCoeur.extractInfoCoeur(event),
event.currentTarget.attributes['data-actor-id'].value) event.currentTarget.attributes['data-actor-id'].value)

View File

@ -1,8 +0,0 @@
import { CommonDescription } from "./description.mjs";
import { CommonInventaire } from "./inventaire.mjs";
export const TEMPLATE_DESCRIPTION = new CommonDescription()
export const TEMPLATE_INVENTAIRE = new CommonInventaire()
export const ALL_COMMON_TEMPLATES = [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE]

View File

@ -1,10 +0,0 @@
/**
* class describing common methods implemented by template parts,
* used for sheet/models/documents
*/
export default class CommonTemplate {
fields() { }
handlebars() { return [] }
actions() { return {} }
async prepareContext(item) { }
}

View File

@ -1,32 +0,0 @@
import { RdDTextEditor } from "../apps/rdd-text-roll-editor.js"
import CommonTemplate from "./common-template.mjs"
import { HTMLSTRING } from "./field-types.mjs"
const fields = foundry.data.fields
export class CommonDescription extends CommonTemplate {
fields() {
return {
description: new fields.HTMLField({ ...HTMLSTRING }),
descriptionmj: new fields.HTMLField({ gmOnly: true, ...HTMLSTRING })
}
}
handlebars() {
return [
"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-description.hbs",
]
}
actions() {
return {}
}
async prepareContext(item) {
const enriched = {
description: await RdDTextEditor.enrichHTML(item.system.description, item),
descriptionmj: await RdDTextEditor.enrichHTML(item.system.descriptionmj, item),
}
return { enriched }
}
}

View File

@ -1,9 +0,0 @@
export const INTEGER = { required: true, nullable: false, min: 0, integer: true }
export const DECIMAL = { required: true, nullable: false, min: 0, integer: false } /* TODO: validation de nombre décimales?*/
export const INTEGER_SIGNED = { required: true, nullable: false, integer: true }
export const DECIMAL_SIGNED = { required: true, nullable: false, integer: false }
export const STRING = { required: true, nullable: false, blank: true, trim: true }
export const HTMLSTRING = { initial: "", required: true, nullable: false, blank: true, textSearch: true }
export const MODEL_ARRAY = { initial: [], required: true, nullable: false }

View File

@ -1,36 +0,0 @@
import CommonTemplate from "./common-template.mjs"
import { RARETES } from "../item/raretes.js"
import { DECIMAL, INTEGER, INTEGER_SIGNED, MODEL_ARRAY, STRING } from "./field-types.mjs"
const fields = foundry.data.fields
export class CommonInventaire extends CommonTemplate {
fields() {
return {
encombrement: new fields.NumberField({ label: "Encombrement", initial: 0, ...INTEGER }),
quantite: new fields.NumberField({ label: "Quantité", initial: 1, ...INTEGER }),
qualite: new fields.NumberField({ label: "Qualité", initial: 0, ...INTEGER_SIGNED }),
cout: new fields.NumberField({ label: "Coût", initial: 0.0, ...DECIMAL }),
environnement: new fields.ArrayField(
new fields.SchemaField({
milieu: new fields.StringField({ label: "Milieu", initial: "", ...STRING }),
rarete: new fields.StringField({
label: "Rareté", initial: RARETES[0].code, ...STRING,
validate: (value, options) => RARETES.find(it => it.code == value)
}),
frequence: new fields.NumberField({ label: "Fréquence", initial: RARETES[0].frequence, ...INTEGER }),
}),
{ label: "Environnement", ...MODEL_ARRAY }),
}
}
handlebars() {
return [
"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-inventaire.hbs"
]
}
async prepareContext(item) {
return {}
}
}

View File

@ -1,3 +0,0 @@
export { default as RdDModelMonnaie } from "./monnaie.mjs"
export { default as RdDModelMunition } from "./munition.mjs"
export { default as RdDModelTarot } from "./tarot.mjs"

View File

@ -1,11 +0,0 @@
import { RdDItem } from "../item.js";
export default class RdDItemMonnaie extends RdDItem {
constructor(data, context) {
if (!data.img) {
data.img = 'systems/foundryvtt-reve-de-dragon/icons/objets/piece_etain_poisson.webp'
}
super(data, context);
}
}

View File

@ -1,7 +0,0 @@
import { RdDItem } from "../item.js";
export default class RdDItemMunition extends RdDItem {
static get defaultIcon() {
return 'systems/foundryvtt-reve-de-dragon/icons/objets/fleche.webp'
}
}

View File

@ -1,7 +0,0 @@
import { RdDItem } from "../item.js";
export default class RdDItemTarot extends RdDItem {
static get defaultIcon() {
return 'systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.webp'
}
}

View File

@ -120,13 +120,13 @@ export class RdDItemArme extends Item {
static defenseArmeParade(armeAttaque, armeParade) { static defenseArmeParade(armeAttaque, armeParade) {
const defCategory = RdDItemArme.getCategorieParade(armeParade) const defCategory = RdDItemArme.getCategorieParade(armeParade)
if (defCategory == 'boucliers') { if (defCategory == 'bouclier') {
return 'norm' return 'norm'
} }
if (armeAttaque?.system?.competence?.toLowerCase().match(/(fléau)/)) { if (armeAttaque.system.competence.toLowerCase().match(/(fléau)/)) {
return '' return ''
} }
if (armeParade.system?.tir) { if (armeParade.system.tir) {
return '' return ''
} }
const attCategory = RdDItemArme.getCategorieParade(armeAttaque) const attCategory = RdDItemArme.getCategorieParade(armeAttaque)

View File

@ -14,11 +14,12 @@ import { RdDItem } from "./item.js";
import { FLEUVE_COORD, TMRUtility } from "./tmr-utility.js"; import { FLEUVE_COORD, TMRUtility } from "./tmr-utility.js";
import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js"; import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js";
import { ItemAction } from "./item/item-actions.js"; import { ItemAction } from "./item/item-actions.js";
import { RdDItemGemme } from "./item/gemme.js";
/** /**
* Extend the basic ItemSheet for RdD specific items * Extend the basic ItemSheet for RdD specific items
*/ */
export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet { export class RdDItemSheet extends ItemSheet {
static get ITEM_TYPE() { static get ITEM_TYPE() {
return undefined return undefined
@ -31,7 +32,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet {
} }
static register(sheetClass) { static register(sheetClass) {
foundry.documents.collections.Items.registerSheet(SYSTEM_RDD, sheetClass, { Items.registerSheet(SYSTEM_RDD, sheetClass, {
label: Misc.typeName('Item', sheetClass.ITEM_TYPE), label: Misc.typeName('Item', sheetClass.ITEM_TYPE),
types: [sheetClass.ITEM_TYPE], types: [sheetClass.ITEM_TYPE],
makeDefault: true makeDefault: true
@ -42,7 +43,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet {
static get defaultOptions() { static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, { return foundry.utils.mergeObject(super.defaultOptions, {
classes: [SYSTEM_RDD, "sheet", "item"], classes: [SYSTEM_RDD, "sheet", "item"],
template: RdDItemSheetV1.defaultTemplate(RdDItemSheetV1.ITEM_TYPE), template: RdDItemSheet.defaultTemplate(RdDItemSheet.ITEM_TYPE),
width: 550, width: 550,
height: 550 height: 550
}, { inplace: false }); }, { inplace: false });
@ -50,7 +51,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet {
/* -------------------------------------------- */ /* -------------------------------------------- */
get template() { get template() {
return RdDItemSheetV1.defaultTemplate(this.item.type); return RdDItemSheet.defaultTemplate(this.item.type);
} }
get title() { get title() {
@ -100,7 +101,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet {
description: await RdDTextEditor.enrichHTML(this.item.system.description, this.item), description: await RdDTextEditor.enrichHTML(this.item.system.description, this.item),
descriptionmj: await RdDTextEditor.enrichHTML(this.item.system.descriptionmj, this.item), descriptionmj: await RdDTextEditor.enrichHTML(this.item.system.descriptionmj, this.item),
isComestible: this.item.getUtilisationCuisine(), isComestible: this.item.getUtilisationCuisine(),
options: RdDSheetUtility.mergeDocumentRights({}, this.item, this.isEditable), options: RdDSheetUtility.mergeDocumentRights(this.options, this.item, this.isEditable),
competences: await SystemCompendiums.getCompetences(ACTOR_TYPES.personnage), competences: await SystemCompendiums.getCompetences(ACTOR_TYPES.personnage),
categories: RdDItem.getCategories(this.item.type), categories: RdDItem.getCategories(this.item.type),
} }
@ -263,7 +264,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet {
_updateObject(event, formData) { _updateObject(event, formData) {
switch (this.item.type) { switch (this.item.type) {
case ITEM_TYPES.sort: case ITEM_TYPES.sort:
formData['system.bonuscase'] = RdDItemSort.bonuscasesToString(RdDItemSheetV1._listCaseTmr( formData['system.bonuscase'] = RdDItemSort.bonuscasesToString(RdDItemSheet._listCaseTmr(
formData.caseTmrCoord, formData.caseTmrCoord,
formData.caseTmrBonus, formData.caseTmrBonus,
formData.caseTmrAdd formData.caseTmrAdd
@ -313,7 +314,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet {
async _onDrop(event) { async _onDrop(event) {
// Try to extract the dragData // Try to extract the dragData
let dragData = RdDItemSheetV1.$extractDragData(event); let dragData = RdDItemSheet.$extractDragData(event);
if (!dragData) return false; if (!dragData) return false;
const allowed = Hooks.call("dropActorSheetData", this.actor, this, dragData); const allowed = Hooks.call("dropActorSheetData", this.actor, this, dragData);
if (allowed === false) return false; if (allowed === false) return false;

View File

@ -56,10 +56,6 @@ export class RdDItemSort extends Item {
return voies.map(voie => RdDItemCompetence.getVoieDraconic(competencesDraconic, voie)) return voies.map(voie => RdDItemCompetence.getVoieDraconic(competencesDraconic, voie))
} }
static getBestDraconicSort(competencesDraconic, sort) {
return RdDItemSort.getDraconicsSort(competencesDraconic, sort).sort(Misc.descending(it => it.system.niveau)).find(it=>true)
}
static getOrdreCode(code) { static getOrdreCode(code) {
return (VOIES_DRACONIC.find(it => it.code == code)?.ordre ?? '?') return (VOIES_DRACONIC.find(it => it.code == code)?.ordre ?? '?')
} }
@ -96,7 +92,7 @@ export class RdDItemSort extends Item {
/* -------------------------------------------- */ /* -------------------------------------------- */
static isCoutVariable(sort) { static isCoutVariable(sort) {
return sort && !Number.isInteger(sort.system.ptreve) && (sort.system.ptreve.toLowerCase() == "variable" || sort.system.ptreve.indexOf("+") >= 0); return sort && (sort.system.ptreve.toLowerCase() == "variable" || sort.system.ptreve.indexOf("+") >= 0);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -78,8 +78,6 @@ export const defaultItemImg = {
souffle: "systems/foundryvtt-reve-de-dragon/icons/souffle_dragon.webp", souffle: "systems/foundryvtt-reve-de-dragon/icons/souffle_dragon.webp",
tarot: "systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.webp", tarot: "systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.webp",
tete: "systems/foundryvtt-reve-de-dragon/icons/tete_dragon.webp", tete: "systems/foundryvtt-reve-de-dragon/icons/tete_dragon.webp",
monnaie:"systems/foundryvtt-reve-de-dragon/icons/objets/piece_etain_poisson.webp",
munition: "systems/foundryvtt-reve-de-dragon/icons/objets/fleche.webp"
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -55,10 +55,6 @@ export class RdDItemRace extends RdDItem {
isMax(actor, code, value = undefined) { isMax(actor, code, value = undefined) {
const path = RdDCarac.carac(code)?.path const path = RdDCarac.carac(code)?.path
if (path == undefined) {
// cas des caractéristiques dérivées, pas de max
return false
}
if (value == undefined) { if (value == undefined) {
value = path ? foundry.utils.getProperty(actor, path) : 0 value = path ? foundry.utils.getProperty(actor, path) : 0
} }

View File

@ -1,14 +1,14 @@
import { HtmlUtility } from "../html-utility.js"; import { HtmlUtility } from "../html-utility.js";
import { RdDItemSheetV1 } from "../item-sheet.js"; import { RdDItemSheet } from "../item-sheet.js";
import { Misc } from "../misc.js"; import { Misc } from "../misc.js";
import { RdDRaretes } from "./raretes.js"; import { RdDRaretes } from "./raretes.js";
const TYPE_ITEMS_NATURELS = ["faune", "herbe", "plante", "ingredient"]; const TYPE_ITEMS_NATURELS = ["faune", "herbe", "plante", "ingredient"];
export class RdDItemInventaireSheet extends RdDItemSheetV1 { export class RdDItemInventaireSheet extends RdDItemSheet {
static get defaultOptions() { static get defaultOptions() {
return foundry.utils.mergeObject(RdDItemSheetV1.defaultOptions, { return foundry.utils.mergeObject(RdDItemSheet.defaultOptions, {
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "informations" }] tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "informations" }]
}, { inplace: false }) }, { inplace: false })
} }

View File

@ -1,6 +1,6 @@
import { RdDItemSheetV1 } from "../item-sheet.js"; import { RdDItemSheet } from "../item-sheet.js";
export class RdDBlessureItemSheet extends RdDItemSheetV1 { export class RdDBlessureItemSheet extends RdDItemSheet {
static get ITEM_TYPE() { return "blessure" }; static get ITEM_TYPE() { return "blessure" };

View File

@ -9,7 +9,7 @@ export class RdDFauneItemSheet extends RdDItemInventaireSheet {
if (!this.options.editable) return; if (!this.options.editable) return;
$(html).find("a.linked-actor-delete").click(async event => await this.onDeleteLinkedActor()); html.find("a.linked-actor-delete").click(async event => await this.onDeleteLinkedActor());
} }
async _onDropActor(event, dragData) { async _onDropActor(event, dragData) {

View File

@ -1,7 +1,7 @@
import { RdDRencontre } from "./rencontre.js"; import { RdDRencontre } from "./rencontre.js";
import { RdDItemSheetV1 } from "../item-sheet.js"; import { RdDItemSheet } from "../item-sheet.js";
export class RdDRencontreItemSheet extends RdDItemSheetV1 { export class RdDRencontreItemSheet extends RdDItemSheet {
static get ITEM_TYPE() { return "rencontre" }; static get ITEM_TYPE() { return "rencontre" };

View File

@ -1,6 +1,6 @@
import { RdDItemSheetV1 } from "../item-sheet.js"; import { RdDItemSheet } from "../item-sheet.js";
export class RdDServiceItemSheet extends RdDItemSheetV1 { export class RdDServiceItemSheet extends RdDItemSheet {
static get ITEM_TYPE() { return "service" }; static get ITEM_TYPE() { return "service" };

View File

@ -1,12 +1,12 @@
import { RdDItemSheetV1 } from "../item-sheet.js"; import { RdDItemSheet } from "../item-sheet.js";
import { RdDItemSigneDraconique } from "./signedraconique.js"; import { RdDItemSigneDraconique } from "./signedraconique.js";
import { TMRUtility } from "../tmr-utility.js"; import { TMRUtility } from "../tmr-utility.js";
/** /**
* Item sheet pour signes draconiques * Item sheet pour signes draconiques
* @extends {RdDItemSheetV1} * @extends {RdDItemSheet}
*/ */
export class RdDSigneDraconiqueItemSheet extends RdDItemSheetV1 { export class RdDSigneDraconiqueItemSheet extends RdDItemSheet {
static get ITEM_TYPE() { return "signedraconique" } static get ITEM_TYPE() { return "signedraconique" }
@ -36,9 +36,9 @@ export class RdDSigneDraconiqueItemSheet extends RdDItemSheetV1 {
if (!this.options.editable) return; if (!this.options.editable) return;
$(html).find(".signe-aleatoire").click(async event => await this.setSigneAleatoire()); html.find(".signe-aleatoire").click(async event => await this.setSigneAleatoire());
$(html).find("input.select-tmr").change(async event => await this.onSelectTmr(event)); html.find("input.select-tmr").change(async event => await this.onSelectTmr(event));
$(html).find(".signe-xp-sort").change(async event => await this.onValeurXpSort(event.currentTarget.attributes['data-typereussite']?.value, Number(event.currentTarget.value))); html.find(".signe-xp-sort").change(async event => await this.onValeurXpSort(event.currentTarget.attributes['data-typereussite']?.value, Number(event.currentTarget.value)));
} }
async setSigneAleatoire() { async setSigneAleatoire() {

View File

@ -3,10 +3,10 @@ import { SYSTEM_RDD } from "../constants.js";
import { Misc } from "../misc.js"; import { Misc } from "../misc.js";
export class RdDJournalSheet extends foundry.appv1.sheets.JournalTextPageSheet { export class RdDJournalSheet extends JournalTextPageSheet {
static register() { static register() {
foundry.applications.apps.DocumentSheetConfig.unregisterSheet(JournalEntryPage, "core", foundry.appv1.sheets.JournalTextPageSheet) DocumentSheetConfig.unregisterSheet(JournalEntryPage, "core", JournalTextPageSheet)
foundry.applications.apps.DocumentSheetConfig.registerSheet(JournalEntryPage, DocumentSheetConfig.registerSheet(JournalEntryPage,
SYSTEM_RDD, SYSTEM_RDD,
RdDJournalSheet, { RdDJournalSheet, {
types: ["text"], types: ["text"],

View File

@ -1,3 +0,0 @@
export { default as RdDModelMonnaie } from "./monnaie.mjs"
export { default as RdDModelMunition } from "./munition.mjs"
export { default as RdDModelTarot } from "./tarot.mjs"

View File

@ -1,10 +0,0 @@
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../common/_module.mjs";
export default class RdDModelMonnaie extends foundry.abstract.TypeDataModel {
static defineSchema() {
return Object.assign({},
TEMPLATE_DESCRIPTION.fields(),
TEMPLATE_INVENTAIRE.fields()
)
}
}

View File

@ -1,10 +0,0 @@
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../common/_module.mjs";
export default class RdDModelMunition extends foundry.abstract.TypeDataModel {
static defineSchema() {
return Object.assign({},
TEMPLATE_DESCRIPTION.fields(),
TEMPLATE_INVENTAIRE.fields()
)
}
}

View File

@ -1,18 +0,0 @@
import { TEMPLATE_DESCRIPTION } from "../common/_module.mjs";
import { DECIMAL, INTEGER, INTEGER_SIGNED, MODEL_ARRAY, STRING } from "../common/field-types.mjs"
const fields = foundry.data.fields
export default class RdDModelTarot extends foundry.abstract.TypeDataModel {
static defineSchema() {
let tarotFields = {
concept : new fields.StringField({ label: "Concept", initial: "", ...STRING }),
aspect : new fields.StringField({ label: "Aspect", initial: "", ...STRING }),
frequence : new fields.NumberField({ label: "Fréquence", initial: 1, ...INTEGER })
}
return Object.assign({},
TEMPLATE_DESCRIPTION.fields(),
tarotFields
)
}
}

View File

@ -483,7 +483,7 @@ export class RdDCombat {
'.appel-destinee-attaque', '.appel-destinee-attaque',
'.echec-total-attaque', '.echec-total-attaque',
]) { ]) {
$(html).on("click", button, event => { html.on("click", button, event => {
const rddCombat = RdDCombat.rddCombatForAttackerAndDefender( const rddCombat = RdDCombat.rddCombatForAttackerAndDefender(
event.currentTarget.attributes['data-attackerId']?.value, event.currentTarget.attributes['data-attackerId']?.value,
event.currentTarget.attributes['data-attackerTokenId']?.value, event.currentTarget.attributes['data-attackerTokenId']?.value,
@ -494,7 +494,7 @@ export class RdDCombat {
} }
}); });
} }
$(html).on("click", 'a.chat-jet-vie', event => { html.on("click", 'a.chat-jet-vie', event => {
event.preventDefault(); event.preventDefault();
RdDCombat._callJetDeVie(event); RdDCombat._callJetDeVie(event);
}); });
@ -934,7 +934,7 @@ export class RdDCombat {
let defenses = defender.items.filter(it => RdDItemArme.isParade(it)) let defenses = defender.items.filter(it => RdDItemArme.isParade(it))
defenses = foundry.utils.duplicate(defenses) defenses = foundry.utils.duplicate(defenses)
defenses.forEach(armeDefense => { defenses.forEach(armeDefense => {
// Ajout du # d'utilisation ce round // Ajout du # d'utilisation ce round
armeDefense.nbUsage = defender.getItemUse(armeDefense.id) armeDefense.nbUsage = defender.getItemUse(armeDefense.id)
armeDefense.typeParade = RdDItemArme.defenseArmeParade(armeAttaque, armeDefense) armeDefense.typeParade = RdDItemArme.defenseArmeParade(armeAttaque, armeDefense)
}) })
@ -1047,12 +1047,11 @@ export class RdDCombat {
async _onParade(defenderRoll) { async _onParade(defenderRoll) {
if (RdDCombat.isParticuliere(defenderRoll)) {
return await this._onParadeParticuliere(defenderRoll)
}
if (RdDCombat.isReussite(defenderRoll)) { if (RdDCombat.isReussite(defenderRoll)) {
await this._onParadeNormale(defenderRoll) return await this._onParadeNormale(defenderRoll)
if (RdDCombat.isParticuliere(defenderRoll)) {
await this._onParadeParticuliere(defenderRoll)
}
return
} }
await this._onParadeEchec(defenderRoll) await this._onParadeEchec(defenderRoll)
} }
@ -1136,12 +1135,11 @@ export class RdDCombat {
} }
async _onEsquive(defenderRoll) { async _onEsquive(defenderRoll) {
if (RdDCombat.isParticuliere(defenderRoll)) {
return await this._onEsquiveParticuliere(defenderRoll)
}
if (RdDCombat.isReussite(defenderRoll)) { if (RdDCombat.isReussite(defenderRoll)) {
await this._onEsquiveNormale(defenderRoll) return await this._onEsquiveNormale(defenderRoll)
if (RdDCombat.isParticuliere(defenderRoll)) {
await this._onEsquiveParticuliere(defenderRoll)
}
return
} }
return await this._onEsquiveEchec(defenderRoll) return await this._onEsquiveEchec(defenderRoll)
} }

View File

@ -9,7 +9,7 @@ export class RdDCompendiumOrganiser {
console.log('onRenderCompendium', compendium, html, compendiumData); console.log('onRenderCompendium', compendium, html, compendiumData);
const pack = compendium.collection const pack = compendium.collection
if (pack.metadata.system === SYSTEM_RDD) { if (pack.metadata.system === SYSTEM_RDD) {
$(html).find('.directory-item').each((i, element) => { html.find('.directory-item').each((i, element) => {
RdDCompendiumOrganiser.setEntityTypeName(pack, element); RdDCompendiumOrganiser.setEntityTypeName(pack, element);
}); });
} }
@ -26,7 +26,7 @@ export class RdDCompendiumOrganiser {
} }
} }
static getEntityTypeLabel(entity) { static getEntityTypeLabel(entity) {
const documentName = entity?.documentName const documentName = entity?.documentName
const type = entity?.type const type = entity?.type

View File

@ -12,7 +12,7 @@ const imgHeures = [1, 2, 3, 4, 5, 6, 7, 9, 9, 10, 11, 12].map(heure => {
const imgSigneDragon = imgHeures[4] const imgSigneDragon = imgHeures[4]
/** De pour les jets de rencontre */ /** De pour les jets de rencontre */
export class DeTMR extends foundry.dice.terms.Die { export class DeTMR extends Die {
/** @override */ /** @override */
static DENOMINATION = "t"; static DENOMINATION = "t";
@ -50,7 +50,7 @@ export class DeTMR extends foundry.dice.terms.Die {
} }
/** DeDraconique pour le D8 sans limite avec 8=>0 */ /** DeDraconique pour le D8 sans limite avec 8=>0 */
export class DeDraconique extends foundry.dice.terms.Die { export class DeDraconique extends Die {
/** @override */ /** @override */
static DENOMINATION = "r"; static DENOMINATION = "r";
@ -89,7 +89,7 @@ export class DeDraconique extends foundry.dice.terms.Die {
} }
/** De 12 avec les heures */ /** De 12 avec les heures */
export class DeHeure extends foundry.dice.terms.Die { export class DeHeure extends Die {
/** @override */ /** @override */
static DENOMINATION = "h"; static DENOMINATION = "h";

View File

@ -15,36 +15,36 @@ export class RdDEmpoignade {
/* -------------------------------------------- */ /* -------------------------------------------- */
static registerChatCallbacks(html) { static registerChatCallbacks(html) {
$(html).on("click", '.defense-empoignade-cac', event => { html.on("click", '.defense-empoignade-cac', event => {
const chatMessage = ChatUtility.getChatMessage(event); const chatMessage = ChatUtility.getChatMessage(event);
const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage); const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage);
let defenseMode = event.currentTarget.attributes['data-defense-mode'].value let defenseMode = event.currentTarget.attributes['data-defense-mode'].value
RdDEmpoignade.onDefenseEmpoignade(rollData, defenseMode, "Corps à corps", "melee") RdDEmpoignade.onDefenseEmpoignade(rollData, defenseMode, "Corps à corps", "melee")
}); });
$(html).on("click", '.defense-empoignade-esquive', event => { html.on("click", '.defense-empoignade-esquive', event => {
const chatMessage = ChatUtility.getChatMessage(event); const chatMessage = ChatUtility.getChatMessage(event);
const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage); const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage);
let defenseMode = event.currentTarget.attributes['data-defense-mode'].value let defenseMode = event.currentTarget.attributes['data-defense-mode'].value
RdDEmpoignade.onDefenseEmpoignade(rollData, defenseMode, "Esquive", "derobee") RdDEmpoignade.onDefenseEmpoignade(rollData, defenseMode, "Esquive", "derobee")
}); });
$(html).on("click", '.empoignade-poursuivre', event => { html.on("click", '.empoignade-poursuivre', event => {
let attackerId = event.currentTarget.attributes['data-attackerId'].value let attackerId = event.currentTarget.attributes['data-attackerId'].value
let defenderId = event.currentTarget.attributes['data-defenderId'].value let defenderId = event.currentTarget.attributes['data-defenderId'].value
RdDEmpoignade.onAttaqueEmpoignadeValidee(game.actors.get(attackerId), game.actors.get(defenderId)) RdDEmpoignade.onAttaqueEmpoignadeValidee(game.actors.get(attackerId), game.actors.get(defenderId))
}); });
$(html).on("click", '.empoignade-entrainer-sol', event => { html.on("click", '.empoignade-entrainer-sol', event => {
const chatMessage = ChatUtility.getChatMessage(event); const chatMessage = ChatUtility.getChatMessage(event);
const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage); const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage);
RdDEmpoignade.entrainerAuSol(rollData) RdDEmpoignade.entrainerAuSol(rollData)
ChatUtility.removeChatMessageId(chatMessage.id) ChatUtility.removeChatMessageId(chatMessage.id)
}); });
$(html).on("click", '.empoignade-projeter-sol', event => { html.on("click", '.empoignade-projeter-sol', event => {
const chatMessage = ChatUtility.getChatMessage(event); const chatMessage = ChatUtility.getChatMessage(event);
const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage); const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage);
RdDEmpoignade.projeterAuSol(rollData) RdDEmpoignade.projeterAuSol(rollData)
ChatUtility.removeChatMessageId(chatMessage.id) ChatUtility.removeChatMessageId(chatMessage.id)
}); });
$(html).on("change", '.empoignade-perte-endurance', event => { html.on("change", '.empoignade-perte-endurance', event => {
const chatMessage = ChatUtility.getChatMessage(event); const chatMessage = ChatUtility.getChatMessage(event);
const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage); const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage);
if (event.currentTarget.value && event.currentTarget.value != "none") { if (event.currentTarget.value && event.currentTarget.value != "none") {

View File

@ -54,7 +54,7 @@ import { RdDItemSouffle } from "./item/souffle.js"
import { RdDRencontre } from "./item/rencontre.js" import { RdDRencontre } from "./item/rencontre.js"
import { RdDItemSheetV1 } from "./item-sheet.js" import { RdDItemSheet } from "./item-sheet.js"
import { RdDBlessureItemSheet } from "./item/sheet-blessure.js" import { RdDBlessureItemSheet } from "./item/sheet-blessure.js"
import { RdDServiceItemSheet } from "./item/sheet-service.js" import { RdDServiceItemSheet } from "./item/sheet-service.js"
import { RdDRencontreItemSheet } from "./item/sheet-rencontre.js" import { RdDRencontreItemSheet } from "./item/sheet-rencontre.js"
@ -80,10 +80,6 @@ import { RdDItemPotion } from "./item/potion.js"
import { RdDItemGemme } from "./item/gemme.js" import { RdDItemGemme } from "./item/gemme.js"
import { RdDGemmeItemSheet } from "./item/sheet-gemme.js" import { RdDGemmeItemSheet } from "./item/sheet-gemme.js"
import * as models from "./models/_module.mjs"
import * as items from "./documents/_module.mjs"
import * as sheets from "./applications/sheets/_module.mjs"
/** /**
* RdD system * RdD system
* Author: LeRatierBretonnien * Author: LeRatierBretonnien
@ -104,9 +100,6 @@ export class SystemReveDeDragon {
this.RdDHotbar = RdDHotbar this.RdDHotbar = RdDHotbar
this.RdDStatBlockParser = RdDStatBlockParser this.RdDStatBlockParser = RdDStatBlockParser
this.itemClasses = { this.itemClasses = {
monnaie: items.RdDItemMonnaie,
munition: items.RdDItemMunition,
tarot: items.RdDModelTarot,
armure: RdDItemArmure, armure: RdDItemArmure,
blessure: RdDItemBlessure, blessure: RdDItemBlessure,
gemme: RdDItemGemme, gemme: RdDItemGemme,
@ -136,9 +129,6 @@ export class SystemReveDeDragon {
/* -------------------------------------------- */ /* -------------------------------------------- */
onInit() { onInit() {
game.system.rdd = this game.system.rdd = this
globalThis.RdD = game.system
this.AppAstrologie = AppAstrologie this.AppAstrologie = AppAstrologie
console.log(`Initializing Reve de Dragon System Settings`) console.log(`Initializing Reve de Dragon System Settings`)
@ -163,7 +153,7 @@ export class SystemReveDeDragon {
this.initSettings() this.initSettings()
/* -------------------------------------------- */ /* -------------------------------------------- */
// Set an initiative formula for the system // Set an initiative formula for the system
CONFIG.Combat.initiative = { formula: "1+(1d6/10)", decimals: 2 } CONFIG.Combat.initiative = { formula: "1+(1d6/10)", decimals: 2 }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -185,11 +175,6 @@ export class SystemReveDeDragon {
console.log(`Initializing Reve de Dragon Documents`) console.log(`Initializing Reve de Dragon Documents`)
CONFIG.Actor.documentClass = RdDBaseActor CONFIG.Actor.documentClass = RdDBaseActor
CONFIG.Item.documentClass = RdDItem CONFIG.Item.documentClass = RdDItem
CONFIG.Item.dataModels = {
monnaie: models.RdDModelMonnaie,
munition: models.RdDModelMunition,
tarot: models.RdDModelTarot,
}
CONFIG.RDD = { CONFIG.RDD = {
resolutionTable: RdDResolutionTable.resolutionTable, resolutionTable: RdDResolutionTable.resolutionTable,
carac_array: RdDUtility.getCaracArray(), carac_array: RdDUtility.getCaracArray(),
@ -199,51 +184,45 @@ export class SystemReveDeDragon {
/* -------------------------------------------- */ /* -------------------------------------------- */
// Register sheet application classes // Register sheet application classes
foundry.documents.collections.Actors.unregisterSheet("core", foundry.appv1.sheets.ActorSheet) Actors.unregisterSheet("core", ActorSheet)
foundry.documents.collections.Actors.registerSheet(SYSTEM_RDD, RdDCommerceSheet, { types: ["commerce"], makeDefault: true }) Actors.registerSheet(SYSTEM_RDD, RdDCommerceSheet, { types: ["commerce"], makeDefault: true })
foundry.documents.collections.Actors.registerSheet(SYSTEM_RDD, RdDActorSheet, { types: ["personnage"], makeDefault: true }) Actors.registerSheet(SYSTEM_RDD, RdDActorSheet, { types: ["personnage"], makeDefault: true })
foundry.documents.collections.Actors.registerSheet(SYSTEM_RDD, RdDCreatureSheet, { types: ["creature"], makeDefault: true }) Actors.registerSheet(SYSTEM_RDD, RdDCreatureSheet, { types: ["creature"], makeDefault: true })
foundry.documents.collections.Actors.registerSheet(SYSTEM_RDD, RdDActorVehiculeSheet, { types: ["vehicule"], makeDefault: true }) Actors.registerSheet(SYSTEM_RDD, RdDActorVehiculeSheet, { types: ["vehicule"], makeDefault: true })
foundry.documents.collections.Actors.registerSheet(SYSTEM_RDD, RdDActorEntiteSheet, { types: ["entite"], makeDefault: true }) Actors.registerSheet(SYSTEM_RDD, RdDActorEntiteSheet, { types: ["entite"], makeDefault: true })
foundry.documents.collections.Items.unregisterSheet("core", foundry.appv1.sheets.ItemSheet) Items.unregisterSheet("core", ItemSheet)
RdDActorExportSheet.init() RdDActorExportSheet.init()
foundry.documents.collections.Items.registerSheet(SYSTEM_RDD, RdDItemInventaireSheet, { Items.registerSheet(SYSTEM_RDD, RdDItemInventaireSheet, {
types: [ types: [
"objet", "arme", "armure", "livre", "nourritureboisson", "objet", "arme", "armure", "livre", "munition",
"monnaie", "nourritureboisson",
], ],
makeDefault: true makeDefault: true
}) })
Items.registerSheet(SYSTEM_RDD, RdDItemSheet, {
sheets.RdDItemBaseSheet.registerAll(
sheets.RdDMonnaieSheet,
sheets.RdDMunitionSheet,
sheets.RdDTarotSheet
)
foundry.documents.collections.Items.registerSheet(SYSTEM_RDD, RdDItemSheetV1, {
types: [ types: [
"competence", "competencecreature", "competence", "competencecreature",
"recettealchimique", "musique", "chant", "danse", "jeu", "race", "recettealchimique", "musique", "chant", "danse", "jeu", "race",
"recettecuisine", "oeuvre", "meditation", "recettecuisine", "oeuvre", "meditation",
"queue", "ombre", "souffle", "tete", "casetmr", "sort", "sortreserve", "queue", "ombre", "souffle", "tete", "casetmr", "sort", "sortreserve",
"nombreastral", "tache", "maladie", "poison", "possession", "nombreastral", "tache", "maladie", "poison", "possession",
"extraitpoetique", "empoignade" "tarot", "extraitpoetique", "empoignade"
], ],
makeDefault: true makeDefault: true
}) })
RdDItemSheetV1.register(RdDBlessureItemSheet) RdDItemSheet.register(RdDBlessureItemSheet)
RdDItemSheetV1.register(RdDConteneurItemSheet) RdDItemSheet.register(RdDConteneurItemSheet)
RdDItemSheetV1.register(RdDFauneItemSheet) RdDItemSheet.register(RdDFauneItemSheet)
RdDItemSheetV1.register(RdDGemmeItemSheet) RdDItemSheet.register(RdDGemmeItemSheet)
RdDItemSheetV1.register(RdDHerbeItemSheet) RdDItemSheet.register(RdDHerbeItemSheet)
RdDItemSheetV1.register(RdDIngredientItemSheet) RdDItemSheet.register(RdDIngredientItemSheet)
RdDItemSheetV1.register(RdDPlanteItemSheet) RdDItemSheet.register(RdDPlanteItemSheet)
RdDItemSheetV1.register(RdDPotionItemSheet) RdDItemSheet.register(RdDPotionItemSheet)
RdDItemSheetV1.register(RdDRencontreItemSheet) RdDItemSheet.register(RdDRencontreItemSheet)
RdDItemSheetV1.register(RdDServiceItemSheet) RdDItemSheet.register(RdDServiceItemSheet)
RdDItemSheetV1.register(RdDSigneDraconiqueItemSheet) RdDItemSheet.register(RdDSigneDraconiqueItemSheet)
RdDJournalSheet.register() RdDJournalSheet.register()
// préparation des différents modules // préparation des différents modules

View File

@ -104,8 +104,8 @@ export class RdDPossession {
rollData.selectedCarac = carac.reve rollData.selectedCarac = carac.reve
} }
else { else {
rollData.selectedCarac = rollingActor.system.carac.reve
rollData.forceCarac = { 'reve-actuel': { label: "Rêve Actuel", value: rollingActor.getReveActuel() } } rollData.forceCarac = { 'reve-actuel': { label: "Rêve Actuel", value: rollingActor.getReveActuel() } }
rollData.selectedCarac = rollData.forceCarac['reve-actuel']
rollData.competence.system.defaut_carac = 'reve-actuel' rollData.competence.system.defaut_carac = 'reve-actuel'
} }
} }

View File

@ -268,7 +268,7 @@ export class RdDResolutionTable {
maxCarac = Math.min(maxCarac, minCarac + 20); maxCarac = Math.min(maxCarac, minCarac + 20);
minLevel = Math.max(minLevel, -10); minLevel = Math.max(minLevel, -10);
maxLevel = Math.max(Math.min(maxLevel, 30), minLevel + colonnes); maxLevel = Math.max(Math.min(maxLevel, 30), minLevel + colonnes);
return await foundry.applications.handlebars.renderTemplate('systems/foundryvtt-reve-de-dragon/templates/resolution-table.hbs', { return await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/resolution-table.hbs', {
carac: carac, carac: carac,
difficulte: level, difficulte: level,
min: minLevel, min: minLevel,

View File

@ -12,6 +12,6 @@ export class RdDRollResult {
static async buildRollDataHtml(rollData, template = 'chat-resultat-general.hbs') { static async buildRollDataHtml(rollData, template = 'chat-resultat-general.hbs') {
rollData.show = rollData.show || {}; rollData.show = rollData.show || {};
return await foundry.applications.handlebars.renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/${template}`, rollData); return await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/${template}`, rollData);
} }
} }

View File

@ -22,7 +22,7 @@ export class RdDRoll extends Dialog {
RdDRoll._ensureCorrectAction(action); RdDRoll._ensureCorrectAction(action);
RdDRoll._setDefaultOptions(actor, rollData); RdDRoll._setDefaultOptions(actor, rollData);
const html = await foundry.applications.handlebars.renderTemplate(dialogConfig.html, rollData); const html = await renderTemplate(dialogConfig.html, rollData);
let options = { classes: ["rdd-roll-dialog"], width: 650, 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) { if (dialogConfig.close) {
@ -145,7 +145,7 @@ export class RdDRoll extends Dialog {
} }
if (this.rollData.selectedSort) { if (this.rollData.selectedSort) {
this.setSelectedSort(this.rollData.selectedSort); this.setSelectedSort(this.rollData.selectedSort);
this.html.find(".draconic").val(this.rollData.selectedSort.system.listIndex); // Uniquement a la selection du sort, pour permettre de changer this.html.find(".draconic").val(this.rollData.selectedSort.system.listIndex); // Uniquement a la selection du sort, pour permettre de changer
} }
RdDItemSort.setCoutReveReel(this.rollData.selectedSort); RdDItemSort.setCoutReveReel(this.rollData.selectedSort);
this.html.find("[name='diffLibre']").val(Misc.toInt(this.rollData.diffLibre)); this.html.find("[name='diffLibre']").val(Misc.toInt(this.rollData.diffLibre));
@ -279,7 +279,7 @@ export class RdDRoll extends Dialog {
async setSelectedSort(sort) { async setSelectedSort(sort) {
this.rollData.selectedSort = sort; // Update the selectedCarac this.rollData.selectedSort = sort; // Update the selectedCarac
this.rollData.competence = RdDItemSort.getBestDraconicSort(this.rollData.draconicList, sort) this.rollData.competence = RdDItemCompetence.getVoieDraconic(this.rollData.draconicList, sort.system.draconic);
this.rollData.bonus = RdDItemSort.getCaseBonus(sort, this.rollData.tmr.coord); this.rollData.bonus = RdDItemSort.getCaseBonus(sort, this.rollData.tmr.coord);
this.rollData.diffLibre = RdDItemSort.getDifficulte(sort, -7); this.rollData.diffLibre = RdDItemSort.getDifficulte(sort, -7);
RdDItemSort.setCoutReveReel(sort); RdDItemSort.setCoutReveReel(sort);
@ -344,7 +344,7 @@ export class RdDRoll extends Dialog {
/* -------------------------------------------- */ /* -------------------------------------------- */
async buildAjustements(rollData) { async buildAjustements(rollData) {
return await foundry.applications.handlebars.renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/partial-roll-ajustements.hbs`, rollData); return await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/partial-roll-ajustements.hbs`, rollData);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -3,11 +3,11 @@ import { RdDItem } from "./item.js";
export class RdDSheetUtility { export class RdDSheetUtility {
static getOptions(document, editable) { static mergeDocumentRights(options, document, editable) {
const userRightLevel = game.user.isGM const userRightLevel = game.user.isGM
? CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER ? CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER
: document.getUserLevel(game.user); : document.getUserLevel(game.user);
return { let newOptions = {
isGM: game.user.isGM, isGM: game.user.isGM,
isOwned: document.parent ? true : false, isOwned: document.parent ? true : false,
editable: editable, editable: editable,
@ -16,15 +16,10 @@ export class RdDSheetUtility {
isObserver: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER, isObserver: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER,
isOwner: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER isOwner: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER
} }
}
static mergeDocumentRights(options, document, editable) {
const newOptions = RdDSheetUtility.getOptions(document, editable);
foundry.utils.mergeObject(options, newOptions); foundry.utils.mergeObject(options, newOptions);
return options; return options;
} }
static getItem(event, actor) { static getItem(event, actor) {
return actor.items.get(RdDSheetUtility.getItemId(event)) return actor.items.get(RdDSheetUtility.getItemId(event))
} }

View File

@ -15,6 +15,7 @@ import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
import { RdDDice } from "./rdd-dice.js"; import { RdDDice } from "./rdd-dice.js";
import { STATUSES } from "./settings/status-effects.js"; import { STATUSES } from "./settings/status-effects.js";
import { RdDRencontre } from "./item/rencontre.js"; import { RdDRencontre } from "./item/rencontre.js";
import { RdDTimestamp } from "./time/rdd-timestamp.js";
import { ITEM_TYPES } from "./constants.js"; import { ITEM_TYPES } from "./constants.js";
import { Misc } from "./misc.js"; import { Misc } from "./misc.js";
@ -47,7 +48,7 @@ export class RdDTMRDialog extends Dialog {
static async create(actor, tmrData) { static async create(actor, tmrData) {
await PixiTMR.init() await PixiTMR.init()
let html = await foundry.applications.handlebars.renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.hbs', tmrData); let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.hbs', tmrData);
if (tmrData.mode != 'visu' && !game.user.isGM) { if (tmrData.mode != 'visu' && !game.user.isGM) {
ChatMessage.create({ content: actor.name + " est monté dans les TMR en mode : " + tmrData.mode, whisper: ChatUtility.getGMs() }); ChatMessage.create({ content: actor.name + " est monté dans les TMR en mode : " + tmrData.mode, whisper: ChatUtility.getGMs() });
} }
@ -82,7 +83,7 @@ export class RdDTMRDialog extends Dialog {
this.subdialog = undefined this.subdialog = undefined
this.displaySize = undefined this.displaySize = undefined
if (!this.viewOnly && !game.user.isGM) { if (!this.viewOnly && !game.user.isGM) {
this.$tellToGM(this.actor.name + " monte dans les terres médianes (" + tmrData.mode + ")"); this._tellToGM(this.actor.name + " monte dans les terres médianes (" + tmrData.mode + ")");
} }
this.callbacksOnAnimate = []; this.callbacksOnAnimate = [];
const displaySize = TMR_DISPLAY_SIZE.clamp(game.settings.get(SYSTEM_RDD, TMR_DISPLAY_SIZE.code) ?? TMR_DISPLAY_SIZE.def); const displaySize = TMR_DISPLAY_SIZE.clamp(game.settings.get(SYSTEM_RDD, TMR_DISPLAY_SIZE.code) ?? TMR_DISPLAY_SIZE.def);
@ -138,7 +139,7 @@ export class RdDTMRDialog extends Dialog {
this.cumulFatigue += this.fatigueParCase; this.cumulFatigue += this.fatigueParCase;
// Le reste... // Le reste...
this.$updateValuesDisplay(); this.updateValuesDisplay();
} }
lancerUnSort() { lancerUnSort() {
@ -189,7 +190,7 @@ export class RdDTMRDialog extends Dialog {
forceTMRContinueAction() { forceTMRContinueAction() {
ui.notifications.warn('Vous devez finir votre action avant de continuer dans les TMR'); ui.notifications.warn('Vous devez finir votre action avant de continuer dans les TMR');
this.bringSubDialogToTop(); this.bringSubDialogToTop();
return false return;
} }
setTMRPendingAction(dialog) { setTMRPendingAction(dialog) {
@ -296,7 +297,7 @@ export class RdDTMRDialog extends Dialog {
const coordOrig = this._getCoordActor(); const coordOrig = this._getCoordActor();
const coordTarget = TMRUtility.deplacement(coordOrig, move); const coordTarget = TMRUtility.deplacement(coordOrig, move);
await this._deplacerDemiReve(coordTarget, 'normal'); await this._deplacerDemiReve(coordTarget, 'normal');
await this.$checkQuitterTMR(); this.checkQuitterTMR();
} }
calculCoutMonteeTMR() { calculCoutMonteeTMR() {
@ -304,7 +305,7 @@ export class RdDTMRDialog extends Dialog {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async $updateValuesDisplay() { async updateValuesDisplay() {
if (this.viewOnly || !this.rendered) { if (this.viewOnly || !this.rendered) {
return; return;
} }
@ -335,31 +336,22 @@ export class RdDTMRDialog extends Dialog {
/* -------------------------------------------- */ /* -------------------------------------------- */
async close() { async close() {
await this.$forceClose(this.actor.name + " a quitté les terres médianes")
}
async $forceClose(message) {
if (this.subdialog) { if (this.subdialog) {
this.forceTMRContinueAction() return this.forceTMRContinueAction()
return false
} }
this.descenteTMR = true; this.descenteTMR = true;
if (this.actor.tmrApp) { if (this.actor.tmrApp) {
this.actor.tmrApp = undefined // Cleanup reference this.actor.tmrApp = undefined; // Cleanup reference
const appliquerFatigue = ReglesOptionnelles.isUsing("appliquer-fatigue")
await this.actor.santeIncDec(
appliquerFatigue ? "fatigue" : "endurance",
(appliquerFatigue ? 1 : -1) * this.cumulFatigue)
if (!this.viewOnly) { if (!this.viewOnly) {
await this.actor.setEffect(STATUSES.StatusDemiReve, false) await this.actor.setEffect(STATUSES.StatusDemiReve, false)
this.$tellToUserAndGM(message) this._tellToGM(this.actor.name + " a quitté les terres médianes");
} }
await this.actor.santeIncDec((ReglesOptionnelles.isUsing("appliquer-fatigue") ? "fatigue" : "endurance"),
this.cumulFatigue)
} }
this.pixiTMR.close();
this.pixiTMR = undefined
await super.close(); await super.close();
return true this.pixiTMR.close()
this.pixiTMR = undefined
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -371,53 +363,48 @@ export class RdDTMRDialog extends Dialog {
} }
switch (action) { switch (action) {
case 'derober': case 'derober':
await this.$derober() await this.derober();
this.restoreTMRAfterAction() this.restoreTMRAfterAction();
return return;
case 'refouler': case 'refouler':
await this.$refouler() await this.refouler();
break break;
case 'maitriser': case 'maitriser':
await this.$maitriserRencontre() await this.maitriserRencontre();
break break;
case 'ignorer': case 'ignorer':
await this.$ignorerRencontre() await this.ignorerRencontre();
break break;
} }
await this.postRencontre(tmr); await this.postRencontre(tmr);
this.restoreTMRAfterAction(); this.restoreTMRAfterAction();
} }
async $derober() { async derober() {
if (this.currentRencontre) { console.log("-> derober", this.currentRencontre);
console.log("-> derober", this.currentRencontre); await this.actor.addTMRRencontre(this.currentRencontre);
await this.actor.addTMRRencontre(this.currentRencontre); this._tellToGM(this.actor.name + " s'est dérobé et quitte les TMR.");
this.$forceClose(`${this.actor.name} s'est dérobé face à la rencontre ${this.currentRencontre.name}, et quitte les TMR.`) this.close();
}
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async $refouler() { async refouler() {
if (this.currentRencontre) { console.log("-> refouler", this.currentRencontre);
console.log("-> refouler", this.currentRencontre); await this.actor.ajouterRefoulement(this.currentRencontre.system.refoulement, `${this.currentRencontre.system.genre == 'f' ? 'une' : 'un'} ${this.currentRencontre.name}`);
await this.actor.ajouterRefoulement(this.currentRencontre.system.refoulement, `${this.currentRencontre.system.genre == 'f' ? 'une' : 'un'} ${this.currentRencontre.name}`); await this.actor.deleteRencontreTMRAtPosition()
await this.$deleteRencontreTMRAtPosition() this.updateTokens();
this.updateTokens(); this.updateValuesDisplay();
this.$updateValuesDisplay(); this.nettoyerRencontre();
this.$nettoyerRencontre();
}
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async $ignorerRencontre() { async ignorerRencontre() {
if (this.currentRencontre) { console.log("-> ignorer", this.currentRencontre);
console.log("-> ignorer", this.currentRencontre); this._tellToGM(this.actor.name + " a ignoré: " + this.currentRencontre.name);
this.$tellToGM(this.actor.name + " a ignoré: " + this.currentRencontre.name); await this.actor.deleteRencontreTMRAtPosition()
await this.$deleteRencontreTMRAtPosition() this.updateTokens();
this.updateTokens(); this.updateValuesDisplay();
this.$updateValuesDisplay(); this.nettoyerRencontre();
this.$nettoyerRencontre();
}
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -434,29 +421,41 @@ export class RdDTMRDialog extends Dialog {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async $checkQuitterTMR() { checkQuitterTMR() {
const reason = this.actor.isDead() if (this.actor.isDead()) {
? "est mort" this._tellToGM("Vous êtes mort : vous quittez les Terres médianes !");
: this.actor.isCumulFatigueCauseSommeil(this.cumulFatigue) this.close();
? "s'écroule de fatigue" return true;
: (this.actor.getReveActuel() == 0)
? "tombe à 0 Points de Rêve"
: undefined
if (reason) {
if (!this.actor.isDead()) {
await this.$refouler()
}
this.$forceClose(`${this.actor.name} ${reason} et quitte les Terres médianes !`)
return true
} }
return false
if (ReglesOptionnelles.isUsing("appliquer-fatigue")
? (this.actor.getFatigueRestante() <= this.cumulFatigue)
: (this.actor.getEnduranceActuelle() <= this.cumulFatigue)
) {
this._tellToGM("Vous vous écroulez de fatigue : vous quittez les Terres médianes !");
this.quitterLesTMRInconscient();
return true;
}
if (this.actor.getReveActuel() == 0) {
this._tellToGM("Vos Points de Rêve sont à 0 : vous quittez les Terres médianes !");
this.quitterLesTMRInconscient();
return true;
}
return false;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async $maitriserRencontre() { async quitterLesTMRInconscient() {
await this.refouler();
this.close();
}
/* -------------------------------------------- */
async maitriserRencontre() {
console.log("-> maitriser", this.currentRencontre); console.log("-> maitriser", this.currentRencontre);
await this.$deleteRencontreTMRAtPosition(); await this.actor.deleteRencontreTMRAtPosition()
this.updateTokens(); this.updateTokens();
let rencontreData = { let rencontreData = {
@ -471,21 +470,11 @@ export class RdDTMRDialog extends Dialog {
tmr: TMRUtility.getTMR(this._getCoordActor()) tmr: TMRUtility.getTMR(this._getCoordActor())
} }
await this.$tentativeMaitrise(rencontreData); await this._tentativeMaitrise(rencontreData);
}
async $deleteRencontreTMRAtPosition() {
const position = this.actor.getDemiReve()
const rencontreIds = this.actor.itemTypes[ITEM_TYPES.rencontre]
.filter(it => it.system.coord == position)
.map(it => it.id)
if (rencontreIds.length > 0) {
await this.actor.deleteEmbeddedDocuments('Item', rencontreIds)
}
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async $tentativeMaitrise(rencData) { async _tentativeMaitrise(rencData) {
this.rencontreState = 'normal'; this.rencontreState = 'normal';
rencData.reve = this.actor.getReveActuel(); rencData.reve = this.actor.getReveActuel();
@ -494,7 +483,7 @@ export class RdDTMRDialog extends Dialog {
RollDataAjustements.calcul(rencData, this.actor); RollDataAjustements.calcul(rencData, this.actor);
rencData.rolled = rencData.presentCite rencData.rolled = rencData.presentCite
? this.$rollPresentCite(rencData) ? this._rollPresentCite(rencData)
: await RdDResolutionTable.roll(rencData.reve, RollDataAjustements.sum(rencData.ajustements)); : await RdDResolutionTable.roll(rencData.reve, RollDataAjustements.sum(rencData.ajustements));
const result = rencData.rolled.isSuccess const result = rencData.rolled.isSuccess
@ -504,41 +493,38 @@ export class RdDTMRDialog extends Dialog {
await RdDRencontre.appliquer(result.effets, this, rencData); await RdDRencontre.appliquer(result.effets, this, rencData);
rencData.poesie = { extrait: result.poesie, reference: result.reference }; rencData.poesie = { extrait: result.poesie, reference: result.reference };
rencData.message = this.$formatMessageRencontre(rencData, result.message); rencData.message = this.formatMessageRencontre(rencData, result.message);
ChatMessage.create({ ChatMessage.create({
whisper: ChatUtility.getOwners(this.actor), whisper: ChatUtility.getOwners(this.actor),
content: await foundry.applications.handlebars.renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-rencontre-tmr.hbs`, rencData) content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-rencontre-tmr.hbs`, rencData)
}); });
this.$updateValuesDisplay(); this.updateValuesDisplay();
if (await this.$checkQuitterTMR()) { if (this.checkQuitterTMR()) {
return; return;
} }
if (this.rencontreState == 'persistant') { if (this.rencontreState == 'persistant') {
this.$nouvelleTentativeMaitrise(rencData); this._nouvelleTentativeMaitrise(rencData);
} }
else if (!this.isRencontreDeplacement()) { else if (!this.isRencontreDeplacement()) {
this.$nettoyerRencontre(); this.nettoyerRencontre();
} }
} }
$nouvelleTentativeMaitrise(rencData) { _nouvelleTentativeMaitrise(rencData) {
setTimeout(() => { setTimeout(() => {
/** // TODO: remplacer par une boucle while(this.currentRencontre) ?
* TODO: remplacer par une boucle while(this.currentRencontre) ?
* ajouter un moyen d'attendre la saisie de l'utilisateur (jet obligatoire)?
*/
rencData.nbRounds++; rencData.nbRounds++;
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) { if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
this.cumulFatigue += this.fatigueParCase; this.cumulFatigue += this.fatigueParCase;
} }
this.$tentativeMaitrise(rencData); this._tentativeMaitrise(rencData);
this.$deleteTmrMessages(rencData.actor, rencData.nbRounds); this._deleteTmrMessages(rencData.actor, rencData.nbRounds);
}, 2000); }, 2000);
} }
$formatMessageRencontre(rencData, template) { formatMessageRencontre(rencData, template) {
let messageDuree = '' let messageDuree = ''
if (rencData.nbRounds > 1) { if (rencData.nbRounds > 1) {
if (rencData.rolled.isSuccess) { if (rencData.rolled.isSuccess) {
@ -557,7 +543,7 @@ export class RdDTMRDialog extends Dialog {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
$rollPresentCite(rencData) { _rollPresentCite(rencData) {
let rolled = RdDResolutionTable.computeChances(rencData.reve, 0); let rolled = RdDResolutionTable.computeChances(rencData.reve, 0);
foundry.utils.mergeObject(rolled, { caracValue: rencData.reve, finalLevel: 0, roll: rolled.score }); foundry.utils.mergeObject(rolled, { caracValue: rencData.reve, finalLevel: 0, roll: rolled.score });
RdDResolutionTable.succesRequis(rolled); RdDResolutionTable.succesRequis(rolled);
@ -565,7 +551,7 @@ export class RdDTMRDialog extends Dialog {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
$deleteTmrMessages(actor, nbRounds = -1) { _deleteTmrMessages(actor, nbRounds = -1) {
setTimeout(() => { setTimeout(() => {
if (nbRounds < 0) { if (nbRounds < 0) {
ChatUtility.removeChatMessageContaining(`<h4 data-categorie="tmr" data-actor-id="${actor._id}"`); ChatUtility.removeChatMessageContaining(`<h4 data-categorie="tmr" data-actor-id="${actor._id}"`);
@ -584,7 +570,7 @@ export class RdDTMRDialog extends Dialog {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
$tellToGM(message) { _tellToGM(message) {
ChatMessage.create({ ChatMessage.create({
user: game.user.id, user: game.user.id,
content: message, content: message,
@ -593,7 +579,7 @@ export class RdDTMRDialog extends Dialog {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
$tellToUserAndGM(message) { _tellToUserAndGM(message) {
ChatMessage.create({ ChatMessage.create({
user: game.user.id, user: game.user.id,
content: message, content: message,
@ -615,7 +601,7 @@ export class RdDTMRDialog extends Dialog {
if (this.currentRencontre) { if (this.currentRencontre) {
if (this.rencontresExistantes.find(it => it.id == this.currentRencontre.id)) { if (this.rencontresExistantes.find(it => it.id == this.currentRencontre.id)) {
// rencontre en attente suite à dérobade // rencontre en attente suite à dérobade
await this.$maitriserRencontre(); await this.maitriserRencontre();
} }
else { else {
const dialog = new RdDTMRRencontreDialog(this.actor, this.currentRencontre, tmr); const dialog = new RdDTMRRencontreDialog(this.actor, this.currentRencontre, tmr);
@ -662,7 +648,7 @@ export class RdDTMRDialog extends Dialog {
tmr: tmr, tmr: tmr,
presentCite: presentCite presentCite: presentCite
}; };
await this.$tentativeMaitrise(rencontreData); await this._tentativeMaitrise(rencontreData);
this.postRencontre(tmr); this.postRencontre(tmr);
} }
@ -741,7 +727,7 @@ export class RdDTMRDialog extends Dialog {
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-maitrise-tmr.hbs`, rollData) content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-maitrise-tmr.hbs`, rollData)
}); });
if (rollData.rolled.isEchec) { if (rollData.rolled.isEchec) {
await this.$forceClose(`n'a pas maîtrisé la case ${rollData.tmr.label} et quitte les terres médianes`) await this.close();
} }
await this.souffleSiEchecTotal(rollData); await this.souffleSiEchecTotal(rollData);
} }
@ -796,7 +782,7 @@ export class RdDTMRDialog extends Dialog {
onConqueteReussie: r => EffetsDraconiques.fermetureCites.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)), onConqueteReussie: r => EffetsDraconiques.fermetureCites.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)),
onConqueteEchec: r => { onConqueteEchec: r => {
this.souffleSiEchecTotal(rollData); this.souffleSiEchecTotal(rollData);
this.$forceClose(`${this.actor.name} n'a pas maîtrisé la ${tmr.label}, et quitte les TMR.`) this.close()
}, },
canClose: false canClose: false
}); });
@ -811,7 +797,7 @@ export class RdDTMRDialog extends Dialog {
onConqueteReussie: r => EffetsDraconiques.periple.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)), onConqueteReussie: r => EffetsDraconiques.periple.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)),
onConqueteEchec: r => { onConqueteEchec: r => {
this.souffleSiEchecTotal(rollData); this.souffleSiEchecTotal(rollData);
this.$forceClose(`${this.actor.name} n'a pas purifié la ${tmr.label}, et quitte les TMR.`) this.close()
}, },
canClose: false canClose: false
}); });
@ -825,7 +811,7 @@ export class RdDTMRDialog extends Dialog {
difficulte: -7, difficulte: -7,
action: 'Conquérir', action: 'Conquérir',
onConqueteReussie: r => EffetsDraconiques.conquete.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)), onConqueteReussie: r => EffetsDraconiques.conquete.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)),
onConqueteEchec: r => this.$forceClose(`${this.actor.name} n'a pas conquis la case ${tmr.label}, et quitte les TMR.`), onConqueteEchec: r => this.close(),
canClose: false canClose: false
}); });
} }
@ -936,15 +922,19 @@ export class RdDTMRDialog extends Dialog {
/* -------------------------------------------- */ /* -------------------------------------------- */
async processSortReserve(sortReserve) { async processSortReserve(sortReserve) {
await this.actor.deleteEmbeddedDocuments('Item', [sortReserve.id]); await this.actor.deleteEmbeddedDocuments('Item', [sortReserve.id]);
console.log("declencheSortEnReserve", sortReserve) console.log("declencheSortEnReserve", sortReserve);
const sort = sortReserve.system.sortid ? this.actor.items.get(sortReserve.system.sortid) : undefined const heureCible = RdDTimestamp.definition(sortReserve.system.heurecible).label;
const message = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-lancement-sortreserve.hbs`, this._tellToUserAndGM(`Vous avez déclenché
{ sortReserve, sort }) ${sortReserve.system.echectotal ? "<strong>l'échec total!</strong>" : "le sort"}
await this.$forceClose(message) en réserve <strong>${sortReserve.name}</strong>
avec ${sortReserve.system.ptreve} points de Rêve
en ${sortReserve.system.coord} (${TMRUtility.getTMRLabel(sortReserve.system.coord)}).
L'heure ciblée est ${heureCible}`);
this.close();
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
$nettoyerRencontre() { nettoyerRencontre() {
// Suppression des dessins des zones possibles // Suppression des dessins des zones possibles
this.currentRencontre?.graphics?.forEach(graphic => this.pixiTMR.removeGraphic(graphic)) this.currentRencontre?.graphics?.forEach(graphic => this.pixiTMR.removeGraphic(graphic))
// Nettoyage de la structureet de l'état // Nettoyage de la structureet de l'état
@ -1031,7 +1021,7 @@ export class RdDTMRDialog extends Dialog {
console.log("STATUS :", this.rencontreState, this.currentRencontre); console.log("STATUS :", this.rencontreState, this.currentRencontre);
} }
await this.$checkQuitterTMR(); this.checkQuitterTMR();
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -1064,13 +1054,13 @@ export class RdDTMRDialog extends Dialog {
*/ */
this.notifierResonanceSigneDraconique(targetCoord); this.notifierResonanceSigneDraconique(targetCoord);
await this.actor.rollUnSort(targetCoord); await this.actor.rollUnSort(targetCoord);
this.$nettoyerRencontre(); this.nettoyerRencontre();
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
externalRefresh() { externalRefresh() {
this.createPixiSprites(); this.createPixiSprites();
this.$updateValuesDisplay(); this.updateValuesDisplay();
this.updateTokens(); this.updateTokens();
console.log("TMR REFRESHED !!!"); console.log("TMR REFRESHED !!!");
} }
@ -1081,7 +1071,7 @@ export class RdDTMRDialog extends Dialog {
return this.forceTMRContinueAction() return this.forceTMRContinueAction()
} }
if (this.currentRencontre != 'normal') { if (this.currentRencontre != 'normal') {
this.$nettoyerRencontre(); this.nettoyerRencontre();
} }
let tmr = TMRUtility.getTMR(targetCoord); let tmr = TMRUtility.getTMR(targetCoord);
// Gestion cases spéciales type Trou noir, etc // Gestion cases spéciales type Trou noir, etc
@ -1093,7 +1083,7 @@ export class RdDTMRDialog extends Dialog {
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) { if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
this.cumulFatigue += this.fatigueParCase; this.cumulFatigue += this.fatigueParCase;
} }
this.$updateValuesDisplay(); this.updateValuesDisplay();
this.actor.notifyRefreshTMR(); this.actor.notifyRefreshTMR();
if (deplacementType == 'normal') { // Pas de rencontres après un saut de type passeur/changeur/... if (deplacementType == 'normal') { // Pas de rencontres après un saut de type passeur/changeur/...

View File

@ -14,8 +14,8 @@ export class RdDTokenHud {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async removeExtensionHud(app, html, tokenId) { static async removeExtensionHud(app, html, tokenId) {
$(html).find('.control-icon.rdd-combat').remove(); html.find('.control-icon.rdd-combat').remove();
$(html).find('.control-icon.rdd-initiative').remove(); html.find('.control-icon.rdd-initiative').remove();
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -50,7 +50,7 @@ export class RdDTokenHud {
{ name: 'Initiative +1', command: 'inc', value: 0.01 }, { name: 'Initiative +1', command: 'inc', value: 0.01 },
{ name: 'Initiative -1', command: 'dec', value: -0.01 }] { name: 'Initiative -1', command: 'dec', value: -0.01 }]
}; };
const controlIconCombat = $(html).find('.control-icon[data-action=combat]'); const controlIconCombat = html.find('.control-icon[data-action=combat]');
await RdDTokenHud._configureSubMenu(controlIconCombat, await RdDTokenHud._configureSubMenu(controlIconCombat,
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.hbs', 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.hbs',
hudData, hudData,
@ -69,7 +69,7 @@ export class RdDTokenHud {
static async addExtensionHudCombat(html, combatant, token, actions) { static async addExtensionHudCombat(html, combatant, token, actions) {
const hudData = { combatant, token, actions, commandes: [] }; const hudData = { combatant, token, actions, commandes: [] };
const controlIconTarget = $(html).find('.control-icon[data-action=target]'); const controlIconTarget = html.find('.control-icon[data-action=target]');
await RdDTokenHud._configureSubMenu(controlIconTarget, 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.hbs', hudData, await RdDTokenHud._configureSubMenu(controlIconTarget, 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.hbs', hudData,
(event) => { (event) => {
const actionIndex = event.currentTarget.attributes['data-action-index']?.value; const actionIndex = event.currentTarget.attributes['data-action-index']?.value;
@ -112,8 +112,7 @@ export class RdDTokenHud {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async addTokenHudExtensions(app, html, tokenId) { static async addTokenHudExtensions(app, html, tokenId) {
console.log(`Adding token HUD extensions for token ${tokenId}`); const controlIconCombat = html.find('.control-icon[data-action=combat]');
const controlIconCombat = $(html).find('.control-icon[data-action=combat]');
if (controlIconCombat.length > 0) { if (controlIconCombat.length > 0) {
controlIconCombat.click(event => { controlIconCombat.click(event => {
if (event.currentTarget.className.includes('active')) { if (event.currentTarget.className.includes('active')) {
@ -130,7 +129,7 @@ export class RdDTokenHud {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async _configureSubMenu(insertionPoint, template, hudData, onMenuItem) { static async _configureSubMenu(insertionPoint, template, hudData, onMenuItem) {
const hud = $(await foundry.applications.handlebars.renderTemplate(template, hudData)); const hud = $(await renderTemplate(template, hudData));
const list = hud.find('div.rdd-hud-list'); const list = hud.find('div.rdd-hud-list');
RdDTokenHud._toggleHudListActive(hud, list); RdDTokenHud._toggleHudListActive(hud, list);

View File

@ -318,7 +318,6 @@ export class RdDUtility {
// gestion des dates et heures // gestion des dates et heures
Handlebars.registerHelper('timestamp-imgSigneHeure', (heure) => { return new Handlebars.SafeString(RdDTimestamp.imgSigneHeure(heure)) }); Handlebars.registerHelper('timestamp-imgSigneHeure', (heure) => { return new Handlebars.SafeString(RdDTimestamp.imgSigneHeure(heure)) });
Handlebars.registerHelper('timestamp-imgSigne', (heure) => { return new Handlebars.SafeString(RdDTimestamp.imgSigne(heure)) }); Handlebars.registerHelper('timestamp-imgSigne', (heure) => { return new Handlebars.SafeString(RdDTimestamp.imgSigne(heure)) });
Handlebars.registerHelper('timestamp-definition', (heure) => RdDTimestamp.definition(heure))
Handlebars.registerHelper('timestamp-extract', timestamp => new RdDTimestamp(timestamp).toCalendrier()); Handlebars.registerHelper('timestamp-extract', timestamp => new RdDTimestamp(timestamp).toCalendrier());
Handlebars.registerHelper('timestamp-formulesDuree', () => RdDTimestamp.formulesDuree()); Handlebars.registerHelper('timestamp-formulesDuree', () => RdDTimestamp.formulesDuree());
Handlebars.registerHelper('timestamp-formulesPeriode', () => RdDTimestamp.formulesPeriode()); Handlebars.registerHelper('timestamp-formulesPeriode', () => RdDTimestamp.formulesPeriode());
@ -349,7 +348,7 @@ export class RdDUtility {
Handlebars.registerHelper('typeTmr-name', type => TMRUtility.typeTmrName(type)); Handlebars.registerHelper('typeTmr-name', type => TMRUtility.typeTmrName(type));
Handlebars.registerHelper('effetRencontre-name', coord => TMRUtility.typeTmrName(coord)); Handlebars.registerHelper('effetRencontre-name', coord => TMRUtility.typeTmrName(coord));
foundry.applications.handlebars.loadTemplates(templatePaths); loadTemplates(templatePaths);
} }
static getItem(itemId, actorId = undefined) { static getItem(itemId, actorId = undefined) {
@ -733,14 +732,14 @@ export class RdDUtility {
RdDTextEditor.registerChatCallbacks(html) RdDTextEditor.registerChatCallbacks(html)
// Gestion spécifique message passeurs // Gestion spécifique message passeurs
$(html).on("click", '.tmr-passeur-coord a', event => { html.on("click", '.tmr-passeur-coord a', event => {
let coord = event.currentTarget.attributes['data-tmr-coord'].value; let coord = event.currentTarget.attributes['data-tmr-coord'].value;
let actorId = event.currentTarget.attributes['data-actor-id'].value; let actorId = event.currentTarget.attributes['data-actor-id'].value;
let actor = game.actors.get(actorId); let actor = game.actors.get(actorId);
actor.tmrApp.positionnerDemiReve(coord); actor.tmrApp.positionnerDemiReve(coord);
}); });
// Gestion spécifique des sorts en réserve multiples (ie têtes) // Gestion spécifique des sorts en réserve multiples (ie têtes)
$(html).on("click", '.declencher-sort-reserve', event => { html.on("click", '.declencher-sort-reserve', event => {
let coord = event.currentTarget.attributes['data-tmr-coord'].value; let coord = event.currentTarget.attributes['data-tmr-coord'].value;
let sortId = event.currentTarget.attributes['data-sort-id'].value; let sortId = event.currentTarget.attributes['data-sort-id'].value;
let actorId = event.currentTarget.attributes['data-actor-id'].value; let actorId = event.currentTarget.attributes['data-actor-id'].value;
@ -750,7 +749,7 @@ export class RdDUtility {
}); });
// gestion bouton tchat Possession // gestion bouton tchat Possession
$(html).on("click", '.defense-possession', event => { html.on("click", '.defense-possession', event => {
let attackerId = event.currentTarget.attributes['data-attackerId'].value let attackerId = event.currentTarget.attributes['data-attackerId'].value
let defenderId = event.currentTarget.attributes['data-defenderId'].value let defenderId = event.currentTarget.attributes['data-defenderId'].value
let possessionId = event.currentTarget.attributes['data-possessionId'].value let possessionId = event.currentTarget.attributes['data-possessionId'].value
@ -758,16 +757,16 @@ export class RdDUtility {
}); });
// gestion bouton tchat Acheter // gestion bouton tchat Acheter
$(html).on("click", '.button-acheter', event => { html.on("click", '.button-acheter', event => {
const venteData = DialogItemAchat.preparerAchat(event.currentTarget); const venteData = DialogItemAchat.preparerAchat(event.currentTarget);
if (venteData) { if (venteData) {
DialogItemAchat.onAcheter(venteData); DialogItemAchat.onAcheter(venteData);
} }
}); });
$(html).on("click", '.button-creer-acteur', event => RdDNameGen.onCreerActeur(event)); html.on("click", '.button-creer-acteur', event => RdDNameGen.onCreerActeur(event));
// Gestion du bouton payer // Gestion du bouton payer
$(html).on("click", '.payer-button', event => { html.on("click", '.payer-button', event => {
let sommeAPayer = Number(event.currentTarget.attributes['data-somme-a-payer']?.value ?? 0); let sommeAPayer = Number(event.currentTarget.attributes['data-somme-a-payer']?.value ?? 0);
let actor = RdDUtility.getSelectedActor("Pour effectuer le paiement:"); let actor = RdDUtility.getSelectedActor("Pour effectuer le paiement:");
if (actor) { if (actor) {
@ -775,8 +774,8 @@ export class RdDUtility {
ChatUtility.removeChatMessageId(RdDUtility.findChatMessageId(event.currentTarget)); ChatUtility.removeChatMessageId(RdDUtility.findChatMessageId(event.currentTarget));
} }
}); });
$(html).on("click", '.rdd-world-content-link', async event => { html.on("click", '.rdd-world-content-link', async event => {
const htmlElement = $(html).find(event.currentTarget); const htmlElement = html.find(event.currentTarget);
const id = htmlElement?.data("id"); const id = htmlElement?.data("id");
const doctype = htmlElement?.data("doctype"); const doctype = htmlElement?.data("doctype");
switch (doctype ?? 'Item') { switch (doctype ?? 'Item') {

View File

@ -75,7 +75,7 @@ export class OptionsAvancees extends FormApplication {
} }
activateListeners(html) { activateListeners(html) {
$(html).find(".select-option").click((event) => { html.find(".select-option").click((event) => {
if (event.currentTarget.attributes.name) { if (event.currentTarget.attributes.name) {
let id = event.currentTarget.attributes.name.value let id = event.currentTarget.attributes.name.value
let isChecked = event.currentTarget.checked let isChecked = event.currentTarget.checked
@ -88,3 +88,4 @@ export class OptionsAvancees extends FormApplication {
this.close() this.close()
} }
} }

View File

@ -19,12 +19,12 @@ const listeReglesOptionnelles = [
{ group: 'Règles de combat', name: 'categorieParade', descr: "Le défenseur doit obtenir une significative en cas de parade avec des armes de catégories différentes" }, { group: 'Règles de combat', name: 'categorieParade', descr: "Le défenseur doit obtenir une significative en cas de parade avec des armes de catégories différentes" },
{ group: 'Règles de combat', name: 'tripleSignificative', descr: "En cas de demi-surprise, d'attaque particulière en finesse, et de catégories d'armes différentes, le défenseur doit obtenir 1/8 des chances de succès" }, { group: 'Règles de combat', name: 'tripleSignificative', descr: "En cas de demi-surprise, d'attaque particulière en finesse, et de catégories d'armes différentes, le défenseur doit obtenir 1/8 des chances de succès" },
{ group: 'Règles de combat', name: 'validation-encaissement-gr', descr: "Le Gardien des Rêves doit valider les jets d'encaissement et peut les changer.", default: false }, { group: 'Règles de combat', name: 'validation-encaissement-gr', descr: "Le Gardien des Rêves doit valider les jets d'encaissement et peut les changer.", default: false },
{ group: 'Automatisation', name: 'chateau-dormant-gardien', descr: "Saisie des heures de sommeil/jets de moral par le gardien des rêves", default: true }, { group: 'Automatisation', name: 'chateau-dormant-gardien', descr: "Saisie des heures de sommeil/jets de moral par le gardien des rêves", default: true },
{ group: 'Affichage', name: 'afficher-colonnes-reussite', descr: "Afficher le nombre de colonnes de réussite ou d'échec", default: false }, { group: 'Affichage', name: 'afficher-colonnes-reussite', descr: "Afficher le nombre de colonnes de réussite ou d'échec", default: false },
{ group: 'Affichage', name: 'afficher-prix-joueurs', descr: "Afficher le prix de l'équipement des joueurs", uniquementJoueur: true}, { group: 'Affichage', name: 'afficher-prix-joueurs', descr: "Afficher le prix de l'équipement des joueurs", uniquementJoueur: true},
{ group: 'Confirmations', name: 'confirmer-combat-sans-cible', descr: "Confirmer avant une attaque sans cible", scope: "client"}, { group: 'Confirmations', name: 'confirmer-combat-sans-cible', descr: "Confirmer avant une attaque sans cible", scope: "client"},
{ group: 'Confirmations', name: 'confirmation-tmr', descr: "Confirmer pour monter dans les TMR", scope: "client"}, { group: 'Confirmations', name: 'confirmation-tmr', descr: "Confirmer pour monter dans les TMR", scope: "client"},
{ group: 'Confirmations', name: 'confirmation-tmr-rencontre', descr: "Confirmer pour monter dans les TMR avec rencontre en attente", scope: "client"}, { group: 'Confirmations', name: 'confirmation-tmr-rencontre', descr: "Confirmer pour monter dans les TMR avec rencontre en attente", scope: "client"},
@ -112,7 +112,7 @@ export class ReglesOptionnelles extends FormApplication {
} }
activateListeners(html) { activateListeners(html) {
$(html).find(".select-option").click((event) => { html.find(".select-option").click((event) => {
if (event.currentTarget.attributes.name) { if (event.currentTarget.attributes.name) {
let id = event.currentTarget.attributes.name.value; let id = event.currentTarget.attributes.name.value;
let isChecked = event.currentTarget.checked; let isChecked = event.currentTarget.checked;
@ -125,3 +125,4 @@ export class ReglesOptionnelles extends FormApplication {
this.close(); this.close();
} }
} }

View File

@ -131,7 +131,7 @@ export class StatusEffects extends FormApplication {
} }
activateListeners(html) { activateListeners(html) {
$(html).find(".select-effect").click((event) => { html.find(".select-effect").click((event) => {
let id = event.currentTarget.attributes.name?.value; let id = event.currentTarget.attributes.name?.value;
if (id) { if (id) {
let selected = StatusEffects._getUseStatusEffects(); let selected = StatusEffects._getUseStatusEffects();
@ -151,3 +151,4 @@ export class StatusEffects extends FormApplication {
this.close(); this.close();
} }
} }

View File

@ -184,7 +184,7 @@ export class SystemCompendiums extends FormApplication {
} }
activateListeners(html) { activateListeners(html) {
$(html).find("select.system-compendium-setting").change((event) => { html.find("select.system-compendium-setting").change((event) => {
const compendium = $(event.currentTarget).data('compendium') const compendium = $(event.currentTarget).data('compendium')
const value = $(event.currentTarget).val(); const value = $(event.currentTarget).val();
const systemCompendium = CONFIGURABLE_COMPENDIUMS[compendium]; const systemCompendium = CONFIGURABLE_COMPENDIUMS[compendium];

View File

@ -9,7 +9,7 @@ export class DialogChateauDormant extends Dialog {
motifStress: `Nuit du ${date}`, motifStress: `Nuit du ${date}`,
finChateauDormant: game.system.rdd.calendrier.getTimestampFinChateauDormant() finChateauDormant: game.system.rdd.calendrier.getTimestampFinChateauDormant()
}; };
const html = await foundry.applications.handlebars.renderTemplate("systems/foundryvtt-reve-de-dragon/templates/sommeil/dialog-chateau-dormant.hbs", const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/sommeil/dialog-chateau-dormant.hbs",
dialogData); dialogData);
new DialogChateauDormant(dialogData, html) new DialogChateauDormant(dialogData, html)
@ -36,7 +36,7 @@ export class DialogChateauDormant extends Dialog {
activateListeners(html) { activateListeners(html) {
super.activateListeners(html); super.activateListeners(html);
this.html = $(html); this.html = html;
this.html.find('input.sommeil-insomnie').change(event => this.onInsomnie(event)); this.html.find('input.sommeil-insomnie').change(event => this.onInsomnie(event));
this._activateListenerOnActorMoral(this.html); this._activateListenerOnActorMoral(this.html);
} }

View File

@ -15,8 +15,6 @@ const TEMPLATE_CALENDRIER = "systems/foundryvtt-reve-de-dragon/templates/time/ca
const INITIAL_CALENDAR_POS = { top: 200, left: 200, horlogeAnalogique: true }; const INITIAL_CALENDAR_POS = { top: 200, left: 200, horlogeAnalogique: true };
/* -------------------------------------------- */ /* -------------------------------------------- */
export class RdDCalendrier extends Application { export class RdDCalendrier extends Application {
static _warnedAppV1 = true
static initSettings() { static initSettings() {
game.settings.register(SYSTEM_RDD, "liste-nombre-astral", { game.settings.register(SYSTEM_RDD, "liste-nombre-astral", {
name: "liste-nombre-astral", name: "liste-nombre-astral",
@ -244,7 +242,7 @@ export class RdDCalendrier extends Application {
} }
/** /**
* *
* @param {*} indexDate la date pour laquelle obtenir le nombre astral. Si undefined, on prend la date du jour * @param {*} indexDate la date pour laquelle obtenir le nombre astral. Si undefined, on prend la date du jour
* @returns le nombre astral pour la date, ou pour la date du jour si la date n'est pas fournie. * @returns le nombre astral pour la date, ou pour la date du jour si la date n'est pas fournie.
* Si aucun nombre astral n'est trouvé, retourne 0 (cas où l'on demanderait un nombre astral en dehors des 12 jours courant et à venir) * Si aucun nombre astral n'est trouvé, retourne 0 (cas où l'on demanderait un nombre astral en dehors des 12 jours courant et à venir)

View File

@ -22,8 +22,8 @@ export class TMRRencontres {
/* -------------------------------------------- */ /* -------------------------------------------- */
/** /**
* Retourne une recontre en fonction de la case et du tirage * Retourne une recontre en fonction de la case et du tirage
* @param {*} terrain * @param {*} terrain
* @param {*} forcedRoll * @param {*} forcedRoll
*/ */
async rollRencontre(terrain, forcedRoll) { async rollRencontre(terrain, forcedRoll) {
const tmrType = TMRUtility.findTMRLike(terrain, { inclusMauvaise: true })?.type const tmrType = TMRUtility.findTMRLike(terrain, { inclusMauvaise: true })?.type
@ -102,7 +102,7 @@ export class TMRRencontres {
/* -------------------------------------------- */ /* -------------------------------------------- */
async $chatRolledRencontre(row, rencontre, tmr) { async $chatRolledRencontre(row, rencontre, tmr) {
const flavorContent = await foundry.applications.handlebars.renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-compendium-table-roll-rencontre.hbs', const flavorContent = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-compendium-table-roll-rencontre.hbs',
{ {
roll: row.roll, roll: row.roll,
rencontre, rencontre,
@ -113,7 +113,7 @@ export class TMRRencontres {
}); });
const messageData = { const messageData = {
user: game.user.id, user: game.user.id,
type: CONST.CHAT_MESSAGE_STYLES.ROLL, type: CONST.CHAT_MESSAGE_TYPES.ROLL,
roll: row.roll, roll: row.roll,
sound: CONFIG.sounds.dice, sound: CONFIG.sounds.dice,
content: flavorContent content: flavorContent

View File

@ -3,9 +3,9 @@ import { Draconique } from "./draconique.js";
import { PixiTMR } from "./pixi-tmr.js"; import { PixiTMR } from "./pixi-tmr.js";
const IMAGE_CARTE_TMR = 'image-carte-tmr'; const IMAGE_CARTE_TMR = 'image-carte-tmr';
const TMR_V1 = "systems/foundryvtt-reve-de-dragon/assets/ui/tmr-v1.webp"; const TMR_V1 = "systems/foundryvtt-reve-de-dragon/styles/img/ui/tmr-v1.webp";
const TMR_V2 = "systems/foundryvtt-reve-de-dragon/assets/ui/tmr-v2.webp"; const TMR_V2 = "systems/foundryvtt-reve-de-dragon/styles/img/ui/tmr-v2.webp";
const TMR_V3_COULEUR = "systems/foundryvtt-reve-de-dragon/assets/ui/tmr-v3-couleur.webp"; const TMR_V3_COULEUR = "systems/foundryvtt-reve-de-dragon/styles/img/ui/tmr-v3-couleur.webp";
export class CarteTmr extends Draconique { export class CarteTmr extends Draconique {

View File

@ -106,9 +106,9 @@ export class DialogFatigueVoyage extends Dialog {
activateListeners(html) { activateListeners(html) {
if (this.html == undefined) { if (this.html == undefined) {
$(html).find('select[name="code-terrain"]').trigger("focus") html.find('select[name="code-terrain"]').trigger("focus")
} }
this.html = $(html); this.html = html;
super.activateListeners(html); super.activateListeners(html);
this.html.find('select[name="code-terrain"]').change(event => this.changeParameters()) this.html.find('select[name="code-terrain"]').change(event => this.changeParameters())

View File

@ -1,37 +1,14 @@
{ {
"name": "foundryvtt-reve-de-dragon",
"description": "<h2><em>Rêve de Dragon</em> pour Foundry Virtual TableTop</h2>",
"private": true,
"version": "1.0.0",
"license": "Creative Commons",
"main": "gulpfile.js",
"scripts": { "scripts": {
"build": "npx vite build", "build": "npx vite build",
"gulp": "gulp",
"run": "npx vite serve",
"packCompendiumsToDist": "node ./tools/packCompendiumsToDist.mjs", "packCompendiumsToDist": "node ./tools/packCompendiumsToDist.mjs",
"packCompendiumsToPublic": "node ./tools/packCompendiumsToPublic.mjs", "packCompendiumsToPublic": "node ./tools/packCompendiumsToPublic.mjs",
"unpackCompendiumsFromPublic": "node ./tools/unpackCompendiumsFromPublic.mjs" "unpackCompendiumsFromPublic": "node ./tools/unpackCompendiumsFromPublic.mjs"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.8.0", "@foundryvtt/foundryvtt-cli": "^1.0.3"
"@foundryvtt/foundryvtt-cli": "^1.0.3",
"commander": "^11.1.0",
"eslint": "^9.9.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jsdoc": "^48.11.0",
"eslint-plugin-prettier": "^5.2.1",
"globals": "^15.9.0",
"less": "^4.1.3",
"prettier": "^3.3.3"
}, },
"dependencies": { "dependencies": {
"gulp": "^5.0.0",
"gulp-less": "^5.0.0",
"rollup-plugin-visualizer": "^5.12.0" "rollup-plugin-visualizer": "^5.12.0"
},
"repository": {
"type": "git",
"url": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon.git"
} }
} }

View File

@ -196,7 +196,7 @@ system:
derivee: false derivee: false
protection: protection:
type: number type: number
value: 10 value: 2
label: Protection label: Protection
derivee: false derivee: false
compteurs: compteurs:

View File

@ -2,7 +2,7 @@ name: Terres médianes du rêve
type: script type: script
scope: global scope: global
author: Hp9ImM4o9YRTSdfu author: Hp9ImM4o9YRTSdfu
img: systems/foundryvtt-reve-de-dragon/assets/ui/icon-tmr-normal.svg img: systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-normal.svg
command: |- command: |-
const selected = game.system.rdd.RdDUtility.getSelectedActor(); const selected = game.system.rdd.RdDUtility.getSelectedActor();
if (!selected) { if (!selected) {
@ -18,8 +18,8 @@ command: |-
title: `Monter dans les TMR`, title: `Monter dans les TMR`,
content: `Monter dans les TMR`, content: `Monter dans les TMR`,
buttons: { buttons: {
normale: { label: `normale`, icon: `<img class="button-img" src="systems/foundryvtt-reve-de-dragon/assets/ui/icon-tmr-normal.svg" alt="Montée dans les Terres M&eacute;dianes !"/>`, callback: () => selected.displayTMR("normal") }, 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&eacute;dianes !"/>`, callback: () => selected.displayTMR("normal") },
rapide: { label: `rapide`, icon: `<img class="button-img" src="systems/foundryvtt-reve-de-dragon/assets/ui/icon-tmr-rapide.svg" alt="Montée accélérée dans les Terres M&eacute;dianes !"/>`, callback: () => selected.displayTMR("rapide") }, 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&eacute;dianes !"/>`, callback: () => selected.displayTMR("rapide") },
}, },
}); });

View File

@ -5,7 +5,7 @@ sort: 0
pages: pages:
- name: 'Figure: Documentation MJ/Joueurs' - name: 'Figure: Documentation MJ/Joueurs'
type: image type: image
src: systems/foundryvtt-reve-de-dragon/assets/logo.webp src: systems/foundryvtt-reve-de-dragon/styles/img/logo.webp
title: title:
show: false show: false
level: 1 level: 1
@ -94,9 +94,9 @@ pages:
<li><img style="background-color:purple;vertical-align:middle" src="icons/svg/bones.svg" width="25" height="30" /> Encaisser des dommages</li> <li><img style="background-color:purple;vertical-align:middle" src="icons/svg/bones.svg" width="25" height="30" /> Encaisser des dommages</li>
<li><img style="background-color:purple;vertical-align:middle" src="icons/svg/regen.svg" width="25" height="30" /> Remise à neuf (Uniquement pour le MJ) pour enlever toutes les blessures/états du personnage.</li> <li><img style="background-color:purple;vertical-align:middle" src="icons/svg/regen.svg" width="25" height="30" /> Remise à neuf (Uniquement pour le MJ) pour enlever toutes les blessures/états du personnage.</li>
<li><img style="background-color:purple;vertical-align:middle" src="icons/svg/sleep.svg" width="25" height="30" /> Le sommeil (dormir une heure, une nuit, gris rêve)</li> <li><img style="background-color:purple;vertical-align:middle" src="icons/svg/sleep.svg" width="25" height="30" /> Le sommeil (dormir une heure, une nuit, gris rêve)</li>
<li><img style="background-color:purple;vertical-align:middle" src="systems/foundryvtt-reve-de-dragon/assets/ui/icon-tmr-normal.svg" width="25" height="30" /> Montée dans les Terres Médianes</li> <li><img style="background-color:purple;vertical-align:middle" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-normal.svg" width="25" height="30" /> Montée dans les Terres Médianes</li>
<li><img style="background-color:purple;vertical-align:middle" src="systems/foundryvtt-reve-de-dragon/assets/ui/icon-tmr-rapide.svg" width="25" height="30" /> Montée rapide</li> <li><img style="background-color:purple;vertical-align:middle" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-rapide.svg" width="25" height="30" /> Montée rapide</li>
<li><img style="background-color:purple;vertical-align:middle" src="systems/foundryvtt-reve-de-dragon/assets/ui/icon-tmr-view.svg" width="25" height="30" /> Regarder ses terres médianes (sans monter)</li> <li><img style="background-color:purple;vertical-align:middle" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-view.svg" width="25" height="30" /> Regarder ses terres médianes (sans monter)</li>
</ul> </ul>
<h1>Combat</h1> <h1>Combat</h1>
<p>Pour l'initiative et les attaques, des options sont disponibles <p>Pour l'initiative et les attaques, des options sont disponibles
@ -171,7 +171,7 @@ pages:
<li>Les retours que vous nous ferez via <a href="https://discord.gg/pPSDNJk">discord</a> <li>Les retours que vous nous ferez via <a href="https://discord.gg/pPSDNJk">discord</a>
(channel #rêve-de-dragon) ;-)</li> (channel #rêve-de-dragon) ;-)</li>
</ul> </ul>
<p><img style="border:0;display:block;margin-left:auto;margin-right:auto" src="systems/foundryvtt-reve-de-dragon/assets/rdd_pause.webp" width="210" height="216" /></p> <p><img style="border:0;display:block;margin-left:auto;margin-right:auto" src="systems/foundryvtt-reve-de-dragon/styles/img/rdd_pause.webp" width="210" height="216" /></p>
_id: p0xOSy6tZwU4DOq5 _id: p0xOSy6tZwU4DOq5
image: {} image: {}
video: video:

View File

@ -5,7 +5,7 @@ sort: 0
pages: pages:
- name: 'Figure: Passeur fou' - name: 'Figure: Passeur fou'
type: image type: image
src: systems/foundryvtt-reve-de-dragon/assets/ui/tmp_main_r1.webp src: systems/foundryvtt-reve-de-dragon/styles/img/ui/tmp_main_r1.webp
title: title:
show: false show: false
level: 1 level: 1

View File

@ -5,7 +5,7 @@ sort: 0
pages: pages:
- name: 'Figure: Tourbillon rouge' - name: 'Figure: Tourbillon rouge'
type: image type: image
src: systems/foundryvtt-reve-de-dragon/assets/ui/tmp_main_r1.webp src: systems/foundryvtt-reve-de-dragon/styles/img/ui/tmp_main_r1.webp
title: title:
show: false show: false
level: 1 level: 1

View File

@ -1,6 +1,6 @@
name: Rêve de Dragon name: Rêve de Dragon
type: rencontre type: rencontre
img: systems/foundryvtt-reve-de-dragon/assets/rdd_pause.webp img: systems/foundryvtt-reve-de-dragon/styles/img/rdd_pause.webp
system: system:
description: '' description: ''
descriptionmj: '' descriptionmj: ''

View File

@ -38,7 +38,7 @@ regions: []
ownership: ownership:
default: 0 default: 0
background: background:
src: systems/foundryvtt-reve-de-dragon/assets/ecran_rdd.webp src: systems/foundryvtt-reve-de-dragon/styles/img/ecran_rdd.webp
offsetX: 0 offsetX: 0
offsetY: 0 offsetY: 0
anchorX: 0 anchorX: 0

4
styles/img/.directory Normal file
View File

@ -0,0 +1,4 @@
[Dolphin]
Timestamp=2020,11,21,13,59,38
Version=4
VisibleRoles=Details_text,Details_size,Details_modificationtime,Details_creationtime,CustomizedDetails

View File

Before

Width:  |  Height:  |  Size: 193 KiB

After

Width:  |  Height:  |  Size: 193 KiB

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

Before

Width:  |  Height:  |  Size: 163 KiB

After

Width:  |  Height:  |  Size: 163 KiB

View File

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 103 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 716 KiB

After

Width:  |  Height:  |  Size: 716 KiB

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Some files were not shown because too many files have changed in this diff Show More