Compare commits
43 Commits
v12
...
c25320755a
Author | SHA1 | Date | |
---|---|---|---|
c25320755a | |||
aa5f159a91 | |||
bb80391a47 | |||
1abb757b6b | |||
84c44d1f6d | |||
ccb939207d | |||
cd38a197cc | |||
6b053b189b | |||
cc4cbbc771 | |||
0850789ed7 | |||
7a6ccac7fa | |||
ed64d823ac | |||
3162264afa | |||
e53eda5b42 | |||
47a7564a1c | |||
f7a6fee51d | |||
0b3f08ef29 | |||
8df9c8ddf5 | |||
4cbe652a91 | |||
3eb1179c40 | |||
cf185844af | |||
250b936fae | |||
cd8268f569 | |||
c04e0cec78 | |||
1d5fe1af71 | |||
e96a627c37 | |||
06c3d2f80a | |||
d07f5a41e7 | |||
856d038dc9 | |||
791593ad38 | |||
42179dab1d | |||
83631cd366 | |||
01cf47ad55 | |||
d492b37a45 | |||
ecdcdb69d5 | |||
8479fdda8a | |||
83e57fbbc7 | |||
2d256b1217 | |||
526d38d32e | |||
2ff3dfef89 | |||
f1b6c01cd7 | |||
675fe5838e | |||
bafdec9924 |
@ -12,6 +12,8 @@ jobs:
|
|||||||
|
|
||||||
#- 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
|
||||||
@ -46,7 +48,7 @@ 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/ fonts/ icons lang/ module/ packs/ pic/ sounds/ styles/ templates/
|
- run: zip -r ./rddsystem.zip system.json template.json README.md LICENSE.txt assets/ css/ 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
|
||||||
@ -62,13 +64,13 @@ jobs:
|
|||||||
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/v11/changelog.md'
|
# notes: 'https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v13/changelog.md'
|
||||||
compatibility-minimum: '12'
|
# compatibility-minimum: '13'
|
||||||
compatibility-verified: '12'
|
# compatibility-verified: '13'
|
@ -1,14 +0,0 @@
|
|||||||
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
|
|
@ -1,14 +0,0 @@
|
|||||||
|
|
||||||
### 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
|
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 193 KiB After Width: | Height: | Size: 193 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 163 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 716 KiB After Width: | Height: | Size: 716 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 188 B After Width: | Height: | Size: 188 B |
Before Width: | Height: | Size: 162 B After Width: | Height: | Size: 162 B |
Before Width: | Height: | Size: 634 KiB After Width: | Height: | Size: 634 KiB |
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 637 KiB After Width: | Height: | Size: 637 KiB |
63
changelog.md
@ -1,4 +1,66 @@
|
|||||||
|
# 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
|
||||||
|
|
||||||
|
- Correction de différentes automatisations de combat incorrectes
|
||||||
|
- Correction des jets `@roll[vue/-2]` qui tentaient de chercher une compétence -2 (à cause des armes à 1/2 mains)
|
||||||
|
|
||||||
|
## 12.0.41 - La loupe d'Astrobazzarh
|
||||||
|
- On peut de nouveau effectuer des tirages cachés
|
||||||
|
- Le stress transformé est bien diminué lorsqu'on met le stress dans une compétence
|
||||||
|
|
||||||
|
## 12.0.40 - Les mains d'Astrobazzarh
|
||||||
|
- correction des attaques particulières en combat
|
||||||
|
- correction de message sur les min/max liés aux modificateurs de races (s'applique uniquement sur la taille)
|
||||||
|
|
||||||
## 12.0.39 - Les mains d'Astrobazzarh
|
## 12.0.39 - Les mains d'Astrobazzarh
|
||||||
- les armes à 1 ou 2 mains fonctionnent dans les liens de jets de dés
|
- les armes à 1 ou 2 mains fonctionnent dans les liens de jets de dés
|
||||||
- commande `/jet` pour poster une demande de jet de dés
|
- commande `/jet` pour poster une demande de jet de dés
|
||||||
@ -546,4 +608,3 @@ 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
|
||||||
|
|
||||||
|
2215
css/foundryvtt-reve-de-dragon.css
Normal file
37
gulpfile.js
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
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"];
|
||||||
|
|
||||||
|
function watchUpdates() {
|
||||||
|
gulp.watch(SIMPLE_LESS, css);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------- */
|
||||||
|
/* Export Tasks
|
||||||
|
/* ----------------------------------------- */
|
||||||
|
|
||||||
|
exports.default = gulp.series(
|
||||||
|
gulp.parallel(css),
|
||||||
|
watchUpdates
|
||||||
|
);
|
||||||
|
exports.css = css;
|
||||||
|
exports.watchUpdates = watchUpdates;
|
45
less/colors.less
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
: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 ============ */
|
||||||
|
--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);
|
||||||
|
}
|
||||||
|
|
84
less/fonts.less
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
/* ==================== (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 */
|
||||||
|
}
|
2089
less/foundryvtt-reve-de-dragon.less
Normal file
10
less/item/monnaie.less
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
.application.sheet.fvtt-rdd {
|
||||||
|
.sheet-common();
|
||||||
|
section.window-content{
|
||||||
|
padding: 0rem;
|
||||||
|
|
||||||
|
section header.sheet-header {
|
||||||
|
.sheet-header();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
32
less/sheets.less
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
.sheet-common() {
|
||||||
|
|
||||||
|
.window-content{
|
||||||
|
font-family: CaslonAntique;
|
||||||
|
text-align: justify;
|
||||||
|
font-size: 1rem;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
|
||||||
|
font-size: calc(var(--font-size-standard) * 1);
|
||||||
|
color: var(--color-dark-1);
|
||||||
|
background: var(--background-image-base) no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.sheet-header() {
|
||||||
|
background: #011d33 url(../assets/ui/bg_header.webp) no-repeat left top;
|
||||||
|
color: rgba(255, 255, 255, 1);
|
||||||
|
|
||||||
|
: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;
|
||||||
|
}
|
||||||
|
}
|
@ -237,7 +237,11 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
|||||||
|
|
||||||
this.html.find('.carac-xp-augmenter').click(async event => await this.actor.updateCaracXPAuto(event.currentTarget.name.replace("augmenter.", "")))
|
this.html.find('.carac-xp-augmenter').click(async event => await this.actor.updateCaracXPAuto(event.currentTarget.name.replace("augmenter.", "")))
|
||||||
this.html.find('.competence-xp-augmenter').click(async event => await this.actor.updateCompetenceXPAuto(RdDSheetUtility.getItemId(event)))
|
this.html.find('.competence-xp-augmenter').click(async event => await this.actor.updateCompetenceXPAuto(RdDSheetUtility.getItemId(event)))
|
||||||
this.html.find('.competence-stress-augmenter').click(async event => await this.actor.updateCompetenceStress(RdDSheetUtility.getItemId(event)))
|
this.html.find('.competence-stress-augmenter').click(async event =>{
|
||||||
|
await this.actor.updateCompetenceStress(RdDSheetUtility.getItemId(event))
|
||||||
|
this.render(true)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
if (this.options.vueDetaillee) {
|
if (this.options.vueDetaillee) {
|
||||||
// On carac change
|
// On carac change
|
||||||
|
185
module/actor.js
@ -243,7 +243,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
await this.resetInfoSommeil()
|
await this.resetInfoSommeil()
|
||||||
ChatMessage.create(message);
|
ChatMessage.create(message);
|
||||||
this.sheet.render(true);
|
setTimeout(() => this.sheet.render(), 20)
|
||||||
}
|
}
|
||||||
|
|
||||||
async _recuperationSante(message) {
|
async _recuperationSante(message) {
|
||||||
@ -279,30 +279,34 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async dormirChateauDormant() {
|
async dormirChateauDormant() {
|
||||||
if (!ReglesOptionnelles.isUsing("chateau-dormant-gardien") || !this.system.sommeil || this.system.sommeil.nouveaujour) {
|
if (!ReglesOptionnelles.isUsing("chateau-dormant-gardien") || !this.system.sommeil || this.system.sommeil.nouveaujour) {
|
||||||
const message = {
|
await this.$dormirChateauDormant();
|
||||||
whisper: ChatUtility.getOwners(this),
|
setTimeout(() => this.sheet.render(), 20)
|
||||||
content: ""
|
|
||||||
};
|
|
||||||
|
|
||||||
await this._recuperationSante(message)
|
|
||||||
await this._recupereMoralChateauDormant(message)
|
|
||||||
await this._recupereChance()
|
|
||||||
await this.transformerStress()
|
|
||||||
await this.retourSeuilDeReve(message)
|
|
||||||
await this.setBonusPotionSoin(0)
|
|
||||||
await this.retourSust(message)
|
|
||||||
await this.$perteReveEnchantementsChateauDormants()
|
|
||||||
await this.$suppressionLancementsSort()
|
|
||||||
await RdDCoeur.applyCoeurChateauDormant(this, message)
|
|
||||||
if (message.content != "") {
|
|
||||||
message.content = `A la fin Chateau Dormant, ${message.content}<br>Un nouveau jour se lève`;
|
|
||||||
ChatMessage.create(message);
|
|
||||||
}
|
|
||||||
await this.resetInfoSommeil();
|
|
||||||
this.sheet.render(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async $dormirChateauDormant() {
|
||||||
|
const message = {
|
||||||
|
whisper: ChatUtility.getOwners(this),
|
||||||
|
content: ""
|
||||||
|
};
|
||||||
|
|
||||||
|
await this._recuperationSante(message);
|
||||||
|
await this._recupereMoralChateauDormant(message);
|
||||||
|
await this._recupereChance();
|
||||||
|
await this.transformerStress();
|
||||||
|
await this.retourSeuilDeReve(message);
|
||||||
|
await this.setBonusPotionSoin(0);
|
||||||
|
await this.retourSust(message);
|
||||||
|
await this.$perteReveEnchantementsChateauDormants();
|
||||||
|
await this.$suppressionLancementsSort();
|
||||||
|
await RdDCoeur.applyCoeurChateauDormant(this, message);
|
||||||
|
if (message.content != "") {
|
||||||
|
message.content = `A la fin Chateau Dormant, ${message.content}<br>Un nouveau jour se lève`;
|
||||||
|
ChatMessage.create(message);
|
||||||
|
}
|
||||||
|
await this.resetInfoSommeil();
|
||||||
|
}
|
||||||
|
|
||||||
async resetInfoSommeil() {
|
async resetInfoSommeil() {
|
||||||
await this.update({
|
await this.update({
|
||||||
'system.sommeil': {
|
'system.sommeil': {
|
||||||
@ -442,10 +446,9 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
message.content += 'Vous ne trouvez pas le sommeil';
|
message.content += 'Vous ne trouvez pas le sommeil';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let jetsReve = [];
|
let dormi = await this.$dormirDesHeures(message, heures, options);
|
||||||
let dormi = await this.dormirDesHeures(jetsReve, message, heures, options);
|
if (dormi.jetsReve.length > 0) {
|
||||||
if (jetsReve.length > 0) {
|
message.content += `Vous récupérez ${dormi.jetsReve.map(it => it < 0 ? '0 (réveil)' : it).reduce(Misc.joining("+"))} Points de rêve. `;
|
||||||
message.content += `Vous récupérez ${jetsReve.map(it => it < 0 ? '0 (réveil)' : it).reduce(Misc.joining("+"))} Points de rêve. `;
|
|
||||||
}
|
}
|
||||||
if (dormi.etat == 'eveil') {
|
if (dormi.etat == 'eveil') {
|
||||||
await this.reveilReveDeDragon(message, dormi.heures);
|
await this.reveilReveDeDragon(message, dormi.heures);
|
||||||
@ -458,11 +461,9 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
ChatMessage.create(message);
|
ChatMessage.create(message);
|
||||||
}
|
}
|
||||||
if (options.chateauDormant) {
|
if (options.chateauDormant) {
|
||||||
await this.dormirChateauDormant();
|
await this.$dormirChateauDormant();
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.sheet.render(true);
|
|
||||||
}
|
}
|
||||||
|
setTimeout(() => this.sheet.render(), 20)
|
||||||
}
|
}
|
||||||
|
|
||||||
async reveilReveDeDragon(message, heures) {
|
async reveilReveDeDragon(message, heures) {
|
||||||
@ -472,18 +473,18 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async dormirDesHeures(jetsReve, message, heures, options) {
|
async $dormirDesHeures(message, heures, options) {
|
||||||
const dormi = { heures: 0, etat: 'dort' };
|
const dormi = { heures: 0, etat: 'dort', jetsReve: [] };
|
||||||
for (; dormi.heures < heures && dormi.etat == 'dort'; dormi.heures++) {
|
for (; dormi.heures < heures && dormi.etat == 'dort'; dormi.heures++) {
|
||||||
await this._recupererEthylisme(message);
|
await this.$recupererEthylisme(message);
|
||||||
if (options.grisReve) {
|
if (options.grisReve) {
|
||||||
await this.recupererFatigue(message);
|
await this.$recupererFatigue(message);
|
||||||
}
|
}
|
||||||
else if (!this.system.sommeil?.insomnie) {
|
else if (!this.system.sommeil?.insomnie) {
|
||||||
await this.recupererFatigue(message);
|
await this.$recupererFatigue(message);
|
||||||
dormi.etat = await this.jetRecuperationReve(jetsReve, message);
|
await this.$jetRecuperationReve(dormi, message);
|
||||||
if (dormi.etat == 'dort' && EffetsDraconiques.isDonDoubleReve(this)) {
|
if (dormi.etat == 'dort' && EffetsDraconiques.isDonDoubleReve(this)) {
|
||||||
dormi.etat = await this.jetRecuperationReve(jetsReve, message);
|
await this.$jetRecuperationReve(dormi, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -491,35 +492,36 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async jetRecuperationReve(jetsReve, message) {
|
async $jetRecuperationReve(dormi, message) {
|
||||||
if (this.getReveActuel() < this.system.reve.seuil.value) {
|
if (this.getReveActuel() < this.system.reve.seuil.value) {
|
||||||
let reve = await RdDDice.rollTotal("1dr");
|
const reve = await RdDDice.rollTotal("1dr")
|
||||||
if (reve >= 7) {
|
if (reve >= 7) {
|
||||||
// Rêve de Dragon !
|
// Rêve de Dragon !
|
||||||
message.content += `Vous faites un <strong>Rêve de Dragon</strong> de ${reve} Points de rêve qui vous réveille! `;
|
message.content += `Vous faites un <strong>Rêve de Dragon</strong> de ${reve} Points de rêve qui vous réveille! `;
|
||||||
await this.combattreReveDeDragon(reve);
|
await this.combattreReveDeDragon(reve);
|
||||||
jetsReve.push(-1);
|
dormi.jetsReve.push(-1);
|
||||||
return 'eveil';
|
dormi.etat = 'eveil'
|
||||||
|
return
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!ReglesOptionnelles.isUsing("recuperation-reve")) {
|
if (!ReglesOptionnelles.isUsing("recuperation-reve")) {
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this),
|
whisper: ChatUtility.getOwners(this),
|
||||||
content: `Pas de récupération de rêve (${reve} points ignorés)`
|
content: `Pas de récupération de rêve (${reve} points ignorés)`
|
||||||
});
|
})
|
||||||
jetsReve.push(0);
|
dormi.jetsReve.push(0)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
await this.reveActuelIncDec(reve);
|
await this.reveActuelIncDec(reve)
|
||||||
jetsReve.push(reve);
|
dormi.jetsReve.push(reve)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 'dort';
|
dormi.etat = 'dort'
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _recupererEthylisme(message) {
|
async $recupererEthylisme(message) {
|
||||||
if (!ReglesOptionnelles.isUsing("recuperation-ethylisme")) { return; }
|
if (!ReglesOptionnelles.isUsing("recuperation-ethylisme")) { return; }
|
||||||
let value = Math.min(Number.parseInt(this.system.compteurs.ethylisme.value) + 1, 1);
|
let value = Math.min(Number.parseInt(this.system.compteurs.ethylisme.value) + 1, 1);
|
||||||
if (value <= 0) {
|
if (value <= 0) {
|
||||||
@ -541,7 +543,6 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
max = Math.floor(max / 2);
|
max = Math.floor(max / 2);
|
||||||
}
|
}
|
||||||
const manquant = max - this.system.sante.endurance.value;
|
const manquant = max - this.system.sante.endurance.value;
|
||||||
|
|
||||||
if (manquant > 0) {
|
if (manquant > 0) {
|
||||||
await this.santeIncDec("endurance", manquant);
|
await this.santeIncDec("endurance", manquant);
|
||||||
message.content += `Vous récuperez ${manquant} points d'endurance. `;
|
message.content += `Vous récuperez ${manquant} points d'endurance. `;
|
||||||
@ -549,15 +550,15 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async recupererFatigue(message) {
|
async $recupererFatigue(message) {
|
||||||
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
||||||
let fatigue = this.system.sante.fatigue.value;
|
let fatigue = this.system.sante.fatigue.value
|
||||||
const fatigueMin = this.getFatigueMin();
|
const fatigueMin = this.getFatigueMin()
|
||||||
if (fatigue <= fatigueMin) {
|
if (fatigue <= fatigueMin) {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
fatigue = Math.max(fatigueMin, this._calculRecuperationSegment(fatigue));
|
fatigue = Math.max(fatigueMin, this._calculRecuperationSegment(fatigue))
|
||||||
await this.update({ "system.sante.fatigue.value": fatigue });
|
await this.update({ 'system.sante.fatigue.value': fatigue });
|
||||||
if (fatigue == 0) {
|
if (fatigue == 0) {
|
||||||
message.content += "Vous êtes complêtement reposé. ";
|
message.content += "Vous êtes complêtement reposé. ";
|
||||||
}
|
}
|
||||||
@ -667,19 +668,23 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
if (!RdDItemRace.checkRacialMax(this, caracName, to)) {
|
if (!RdDItemRace.checkRacialMax(this, caracName, to)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
let updates = {};
|
||||||
if (caracName == LIST_CARAC_PERSONNAGE.reve.code) {
|
if (caracName == LIST_CARAC_PERSONNAGE.reve.code) {
|
||||||
if (to > Misc.toInt(this.system.reve.seuil.value)) {
|
if (to > Misc.toInt(this.system.reve.seuil.value)) {
|
||||||
this.setPointsDeSeuil(to);
|
updates[`system.reve.seuil.value`] = to; // SFA : Direct and packed changes
|
||||||
|
//this.setPointsDeSeuil(to);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (caracName == LIST_CARAC_PERSONNAGE.chance.code) {
|
if (caracName == LIST_CARAC_PERSONNAGE.chance.code) {
|
||||||
if (to > Misc.toInt(this.system.compteurs.chance.value)) {
|
if (to > Misc.toInt(this.system.compteurs.chance.value)) {
|
||||||
this.setPointsDeChance(to);
|
updates[`system.compteurs.chance.value`] = to; // SFA : Direct and packed changes
|
||||||
|
//this.setPointsDeChance(to);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let selectedCarac = this.findCaracByName(caracName);
|
let selectedCarac = this.findCaracByName(caracName);
|
||||||
const from = selectedCarac.value
|
const from = selectedCarac.value
|
||||||
await this.update({ [`system.carac.${caracName}.value`]: to });
|
updates[`system.carac.${caracName}.value`] = to;
|
||||||
|
await this.update(updates);
|
||||||
await ExperienceLog.add(this, XP_TOPIC.CARAC, from, to, caracName);
|
await ExperienceLog.add(this, XP_TOPIC.CARAC, from, to, caracName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -736,7 +741,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
await competence.update({
|
await competence.update({
|
||||||
"system.xp": toXp,
|
"system.xp": toXp,
|
||||||
"system.niveau": toNiveau,
|
"system.niveau": toNiveau,
|
||||||
});
|
}, { render: false })
|
||||||
await ExperienceLog.add(this, XP_TOPIC.XP, fromXp, toXp, competence.name);
|
await ExperienceLog.add(this, XP_TOPIC.XP, fromXp, toXp, competence.name);
|
||||||
await ExperienceLog.add(this, XP_TOPIC.NIVEAU, fromNiveau, toNiveau, competence.name);
|
await ExperienceLog.add(this, XP_TOPIC.NIVEAU, fromNiveau, toNiveau, competence.name);
|
||||||
}
|
}
|
||||||
@ -767,7 +772,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
await competence.update({
|
await competence.update({
|
||||||
"system.xp": newXp,
|
"system.xp": newXp,
|
||||||
"system.niveau": toNiveau,
|
"system.niveau": toNiveau,
|
||||||
});
|
}, { render: false })
|
||||||
const toXpStress = Math.max(0, fromXpStress - xpUtilise);
|
const toXpStress = Math.max(0, fromXpStress - xpUtilise);
|
||||||
await this.update({ "system.compteurs.experience.value": toXpStress });
|
await this.update({ "system.compteurs.experience.value": toXpStress });
|
||||||
|
|
||||||
@ -783,7 +788,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
const toNiveau = compValue ?? RdDItemCompetence.getNiveauBase(competence.system.categorie, competence.getCategories());
|
const toNiveau = compValue ?? RdDItemCompetence.getNiveauBase(competence.system.categorie, competence.getCategories());
|
||||||
this.notifyCompetencesTronc(competence, toNiveau);
|
this.notifyCompetencesTronc(competence, toNiveau);
|
||||||
const fromNiveau = competence.system.niveau;
|
const fromNiveau = competence.system.niveau;
|
||||||
await competence.update({ 'system.niveau': toNiveau });
|
await competence.update({ 'system.niveau': toNiveau }, { render: true })
|
||||||
await ExperienceLog.add(this, XP_TOPIC.NIVEAU, fromNiveau, toNiveau, competence.name, true);
|
await ExperienceLog.add(this, XP_TOPIC.NIVEAU, fromNiveau, toNiveau, competence.name, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -808,7 +813,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
if (isNaN(toXp) || typeof (toXp) != 'number') toXp = 0;
|
if (isNaN(toXp) || typeof (toXp) != 'number') toXp = 0;
|
||||||
const fromXp = competence.system.xp;
|
const fromXp = competence.system.xp;
|
||||||
this.checkCompetenceXP(idOrName, toXp);
|
this.checkCompetenceXP(idOrName, toXp);
|
||||||
await competence.update({ 'system.xp': toXp });
|
await competence.update({ 'system.xp': toXp }, { render: false })
|
||||||
await ExperienceLog.add(this, XP_TOPIC.XP, fromXp, toXp, competence.name, true);
|
await ExperienceLog.add(this, XP_TOPIC.XP, fromXp, toXp, competence.name, true);
|
||||||
if (toXp > fromXp) {
|
if (toXp > fromXp) {
|
||||||
RdDUtility.checkThanatosXP(competence)
|
RdDUtility.checkThanatosXP(competence)
|
||||||
@ -822,7 +827,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
if (competence) {
|
if (competence) {
|
||||||
if (isNaN(toXpSort) || typeof (toXpSort) != 'number') toXpSort = 0;
|
if (isNaN(toXpSort) || typeof (toXpSort) != 'number') toXpSort = 0;
|
||||||
const fromXpSort = competence.system.xp_sort;
|
const fromXpSort = competence.system.xp_sort;
|
||||||
await competence.update({ 'system.xp_sort': toXpSort });
|
await competence.update({ 'system.xp_sort': toXpSort }, { render: false })
|
||||||
await ExperienceLog.add(this, XP_TOPIC.XPSORT, fromXpSort, toXpSort, competence.name, true);
|
await ExperienceLog.add(this, XP_TOPIC.XPSORT, fromXpSort, toXpSort, competence.name, true);
|
||||||
if (toXpSort > fromXpSort) {
|
if (toXpSort > fromXpSort) {
|
||||||
RdDUtility.checkThanatosXP(competence)
|
RdDUtility.checkThanatosXP(competence)
|
||||||
@ -834,7 +839,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
async updateCompetenceArchetype(idOrName, compValue) {
|
async updateCompetenceArchetype(idOrName, compValue) {
|
||||||
let competence = this.getCompetence(idOrName)
|
let competence = this.getCompetence(idOrName)
|
||||||
if (competence) {
|
if (competence) {
|
||||||
await competence.update({ 'system.niveau_archetype': Math.max(compValue ?? 0, 0) });
|
await competence.update({ 'system.niveau_archetype': Math.max(compValue ?? 0, 0) })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1047,20 +1052,10 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async deleteRencontreTMRAtPosition() {
|
|
||||||
const rencontreIds = this.itemTypes[ITEM_TYPES.rencontre].filter(this.filterRencontreTMRDemiReve()).map(it => it.id)
|
|
||||||
if (rencontreIds.length > 0) {
|
|
||||||
await this.deleteEmbeddedDocuments('Item', rencontreIds)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getRencontreTMREnAttente() {
|
getRencontreTMREnAttente() {
|
||||||
return this.itemTypes[ITEM_TYPES.rencontre].find(this.filterRencontreTMRDemiReve())
|
|
||||||
}
|
|
||||||
|
|
||||||
filterRencontreTMRDemiReve() {
|
|
||||||
const position = this.getDemiReve()
|
const position = this.getDemiReve()
|
||||||
return it => it.system.coord == position
|
return this.itemTypes[ITEM_TYPES.rencontre].find(it => it.system.coord == position)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -1560,7 +1555,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
if (!rollData.rolled.isPart ||
|
if (!rollData.rolled.isPart ||
|
||||||
rollData.finalLevel >= 0 ||
|
rollData.finalLevel >= 0 ||
|
||||||
game.settings.get("core", "rollMode") == 'selfroll' ||
|
game.settings.get("core", "rollMode") == 'selfroll' ||
|
||||||
!Misc.hasConnectedGM()) {
|
!Misc.hasConnectedGM()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
hideChatMessage = hideChatMessage == 'hide' || (Misc.isRollModeHiddenToPlayer() && !game.user.isGM)
|
hideChatMessage = hideChatMessage == 'hide' || (Misc.isRollModeHiddenToPlayer() && !game.user.isGM)
|
||||||
@ -1584,7 +1579,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _appliquerAppelMoral(rollData) {
|
async _appliquerAppelMoral(rollData) {
|
||||||
if (!rollData.use.moral || game.settings.get("core", "rollMode") == 'selfroll'){
|
if (!rollData.use.moral || game.settings.get("core", "rollMode") == 'selfroll') {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (rollData.rolled.isEchec ||
|
if (rollData.rolled.isEchec ||
|
||||||
@ -1770,7 +1765,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) {
|
if (!rollData.isSortReserve || !rolled.isSuccess) {
|
||||||
this.tmrApp?.close();
|
this.tmrApp?.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1869,7 +1864,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
competence: competence,
|
competence: competence,
|
||||||
show: { title: options?.title ?? '' }
|
show: { title: options?.title ?? '' }
|
||||||
},
|
},
|
||||||
// TODO:
|
// TODO:
|
||||||
callbacks: [{ action: r => this.$onRollCompetence(r, options) }]
|
callbacks: [{ action: r => this.$onRollCompetence(r, options) }]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1882,7 +1877,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
compData.system.defaut_carac = tacheData.system.carac; // Patch !
|
compData.system.defaut_carac = tacheData.system.carac; // Patch !
|
||||||
|
|
||||||
await this.openRollDialog({
|
await this.openRollDialog({
|
||||||
name: 'jet-competence',
|
name: 'jet-competence',
|
||||||
label: 'Jet de Tâche ' + tacheData.name,
|
label: 'Jet de Tâche ' + tacheData.name,
|
||||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.hbs',
|
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.hbs',
|
||||||
rollData: {
|
rollData: {
|
||||||
@ -1945,9 +1940,9 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await this.openRollDialog({
|
await this.openRollDialog({
|
||||||
name: `jet-${artData.art}`,
|
name: `jet-${artData.art}`,
|
||||||
label: `${artData.verbe} ${oeuvre.name}`,
|
label: `${artData.verbe} ${oeuvre.name}`,
|
||||||
template: `systems/foundryvtt-reve-de-dragon/templates/dialog-roll-${oeuvre.type}.hbs`,
|
template: `systems/foundryvtt-reve-de-dragon/templates/dialog-roll-${oeuvre.type}.hbs`,
|
||||||
rollData: artData,
|
rollData: artData,
|
||||||
callbacks: [{ action: callbackAction }],
|
callbacks: [{ action: callbackAction }],
|
||||||
})
|
})
|
||||||
@ -2116,7 +2111,6 @@ 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) }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
@ -2125,21 +2119,16 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _meditationResult(meditationRoll) {
|
async _meditationResult(meditationRoll) {
|
||||||
this.santeIncDec("fatigue", 2);
|
|
||||||
|
|
||||||
if (meditationRoll.rolled.isSuccess) {
|
if (meditationRoll.rolled.isSuccess) {
|
||||||
await this.createEmbeddedDocuments("Item", [RdDItemSigneDraconique.prepareSigneDraconiqueMeditation(meditationRoll.meditation, meditationRoll.rolled)]);
|
await this.createEmbeddedDocuments("Item", [RdDItemSigneDraconique.prepareSigneDraconiqueMeditation(meditationRoll.meditation, meditationRoll.rolled)]);
|
||||||
}
|
}
|
||||||
|
if (meditationRoll.rolled.isEPart){
|
||||||
|
await 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);
|
||||||
@ -2527,7 +2516,6 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
const blessure = this.getItem(blessureId, 'blessure')
|
const blessure = this.getItem(blessureId, 'blessure')
|
||||||
console.log('TODO update blessure', this, blessureId, rollData, rollData.tache);
|
|
||||||
if (blessure && !blessure.system.premierssoins.done) {
|
if (blessure && !blessure.system.premierssoins.done) {
|
||||||
const tache = rollData.tache;
|
const tache = rollData.tache;
|
||||||
if (rollData.rolled.isETotal) {
|
if (rollData.rolled.isETotal) {
|
||||||
@ -2644,12 +2632,13 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async incDecItemUse(itemId, inc = 1) {
|
async incDecItemUse(itemId, shouldIncrease = true) {
|
||||||
const currentItemUse = this.getFlag(SYSTEM_RDD, 'itemUse');
|
if (shouldIncrease) {
|
||||||
let itemUse = currentItemUse ? foundry.utils.duplicate(currentItemUse) : {};
|
const currentItemUse = this.getFlag(SYSTEM_RDD, 'itemUse');
|
||||||
itemUse[itemId] = (itemUse[itemId] ?? 0) + inc;
|
let itemUse = currentItemUse ? foundry.utils.duplicate(currentItemUse) : {};
|
||||||
await this.setFlag(SYSTEM_RDD, 'itemUse', itemUse);
|
itemUse[itemId] = (itemUse[itemId] ?? 0) + 1;
|
||||||
console.log("ITEM USE INC", inc, itemUse);
|
await this.setFlag(SYSTEM_RDD, 'itemUse', itemUse);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -277,14 +277,9 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
return dialog
|
return dialog
|
||||||
}
|
}
|
||||||
|
|
||||||
createEmptyCallback() {
|
createCallbackExperience() { return { action: r => { } } }
|
||||||
return {
|
createCallbackAppelAuMoral() { return { action: r => { } } }
|
||||||
condition: r => false,
|
|
||||||
action: r => { }
|
|
||||||
};
|
|
||||||
}
|
|
||||||
createCallbackExperience() { return this.createEmptyCallback(); }
|
|
||||||
createCallbackAppelAuMoral() { return this.createEmptyCallback(); }
|
|
||||||
async _onCloseRollDialog(html) { }
|
async _onCloseRollDialog(html) { }
|
||||||
|
|
||||||
async rollCaracCompetence(caracName, compName, diff, options = { title: "" }) {
|
async rollCaracCompetence(caracName, compName, diff, options = { title: "" }) {
|
||||||
|
@ -39,7 +39,12 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
getFatigueRestante() { return this.getFatigueMax() - this.getFatigueActuelle() }
|
isCumulFatigueCauseSommeil(cumulFatigue){
|
||||||
|
return ReglesOptionnelles.isUsing("appliquer-fatigue")
|
||||||
|
? (this.getFatigueRestante() <= cumulFatigue)
|
||||||
|
: (this.getEnduranceActuelle() <= cumulFatigue)
|
||||||
|
}
|
||||||
|
getFatigueRestante() {return this.getFatigueMax() - this.getFatigueActuelle() }
|
||||||
getFatigueMin() { return this.system.sante.endurance.max - this.system.sante.endurance.value }
|
getFatigueMin() { return this.system.sante.endurance.max - this.system.sante.endurance.value }
|
||||||
|
|
||||||
malusFatigue() {
|
malusFatigue() {
|
||||||
|
@ -14,11 +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 ActorSheet {
|
export class RdDBaseActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
return foundry.utils.mergeObject(ActorSheet.defaultOptions, {
|
return foundry.utils.mergeObject(foundry.appv1.sheets.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 }],
|
||||||
|
@ -244,16 +244,19 @@ export class RdDBaseActor extends Actor {
|
|||||||
async onUpdateActor(update, options, actorId) { }
|
async onUpdateActor(update, options, actorId) { }
|
||||||
async onDeleteItem(item, options, id) {
|
async onDeleteItem(item, options, id) {
|
||||||
if (item.isInventaire()) {
|
if (item.isInventaire()) {
|
||||||
this._removeItemFromConteneur(item)
|
await this._removeItemFromConteneur(item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_removeItemFromConteneur(item) {
|
async _removeItemFromConteneur(item) {
|
||||||
this.items.filter(it => it.isConteneur() && it.system.contenu.includes(item.id))
|
const updates = this.items.filter(it => it.isConteneur() && it.system.contenu.includes(item.id))
|
||||||
.forEach(conteneur => {
|
.map(conteneur => {
|
||||||
const nouveauContenu = conteneur.system.contenu.filter(id => id != item.id);
|
const nouveauContenu = conteneur.system.contenu.filter(id => id != item.id)
|
||||||
conteneur.update({ 'system.contenu': nouveauContenu });
|
return { _id: conteneur.id, 'system.contenu': nouveauContenu }
|
||||||
});
|
})
|
||||||
|
if (updates.length > 0) {
|
||||||
|
await this.updateEmbeddedDocuments('Item', updates)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async onTimeChanging(oldTimestamp, newTimestamp) {
|
async onTimeChanging(oldTimestamp, newTimestamp) {
|
||||||
@ -731,7 +734,7 @@ export class RdDBaseActor extends Actor {
|
|||||||
name: this.getAlias(),
|
name: this.getAlias(),
|
||||||
system: { description: this.system.description }
|
system: { description: this.system.description }
|
||||||
}
|
}
|
||||||
renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.hbs', chatData)
|
foundry.applications.handlebars.renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.hbs', chatData)
|
||||||
.then(html => ChatMessage.create(RdDUtility.chatDataSetup(html, modeOverride)));
|
.then(html => ChatMessage.create(RdDUtility.chatDataSetup(html, modeOverride)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -744,7 +747,7 @@ export class RdDBaseActor extends Actor {
|
|||||||
async jetDeMoral() { this.actionImpossible("jet de moral") }
|
async jetDeMoral() { this.actionImpossible("jet de moral") }
|
||||||
|
|
||||||
async resetItemUse() { }
|
async resetItemUse() { }
|
||||||
async incDecItemUse(itemId, inc = 1) { }
|
async incDecItemUse(itemId, shouldIncrease = true) { }
|
||||||
getItemUse(itemId) { return 0; }
|
getItemUse(itemId) { return 0; }
|
||||||
|
|
||||||
async finDeRound(options = { terminer: false }) { }
|
async finDeRound(options = { terminer: false }) { }
|
||||||
|
@ -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() {
|
||||||
loadTemplates([
|
foundry.applications.handlebars.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",
|
||||||
])
|
])
|
||||||
Actors.registerSheet(SYSTEM_RDD, RdDActorExportSheet, { types: ["personnage"], makeDefault: false, label: "Feuille simplifiée" })
|
foundry.documents.collections.Actors.registerSheet(SYSTEM_RDD, RdDActorExportSheet, { types: ["personnage"], makeDefault: false, label: "Feuille simplifiée" })
|
||||||
}
|
}
|
||||||
|
|
||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
|
@ -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/styles/img/ui/scriptarium.svg">'
|
const IMG_SCRIPTARIUM = '<img class="context-menu-img" src="systems/foundryvtt-reve-de-dragon/assets/ui/scriptarium.svg">'
|
||||||
|
|
||||||
export class ExportScriptarium {
|
export class ExportScriptarium {
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ const RANDOM_VALUES = {
|
|||||||
|
|
||||||
export class AppPersonnageAleatoire extends FormApplication {
|
export class AppPersonnageAleatoire extends FormApplication {
|
||||||
static preloadHandlebars() {
|
static preloadHandlebars() {
|
||||||
loadTemplates([
|
foundry.applications.handlebars.loadTemplates([
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs',
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
export { default as RdDItemSheet} from "./common-item-sheet.mjs"
|
export { default as RdDItemBaseSheet} from "./common-item-sheet.mjs"
|
||||||
export { default as RdDMonnaieSheet } from "./monnaie-sheet.mjs"
|
export { default as RdDMonnaieSheet } from "./monnaie-sheet.mjs"
|
||||||
export { default as RdDMunitionSheet } from "./munition-sheet.mjs"
|
export { default as RdDMunitionSheet } from "./munition-sheet.mjs"
|
||||||
|
export { default as RdDTarotSheet } from "./tarot-sheet.mjs"
|
||||||
|
|
||||||
|
@ -1,8 +1,20 @@
|
|||||||
const { HandlebarsApplicationMixin } = foundry.applications.api
|
const { HandlebarsApplicationMixin } = foundry.applications.api
|
||||||
import { SYSTEM_RDD } from "../../constants.js"
|
import { SYSTEM_RDD } from "../../constants.js"
|
||||||
import { Misc } from "../../misc.js"
|
import { Misc } from "../../misc.js"
|
||||||
|
import { RdDSheetUtility } from "../../rdd-sheet-utility.js";
|
||||||
|
|
||||||
export default class RdDItemSheet extends HandlebarsApplicationMixin(foundry.applications.sheets.ItemSheetV2) {
|
|
||||||
|
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) {
|
static register(sheetClass) {
|
||||||
const itemType = sheetClass.ITEM_TYPE
|
const itemType = sheetClass.ITEM_TYPE
|
||||||
@ -13,20 +25,29 @@ export default class RdDItemSheet extends HandlebarsApplicationMixin(foundry.app
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 }
|
static get ITEM_TYPE() { return undefined }
|
||||||
/**
|
|
||||||
* Different sheet modes.
|
|
||||||
* @enum {number}
|
|
||||||
*/
|
|
||||||
static SHEET_MODES = { EDIT: 0, PLAY: 1 }
|
|
||||||
|
|
||||||
constructor(options = {}) {
|
constructor(options = {}) {
|
||||||
super(options)
|
super(options)
|
||||||
this.#dragDrop = this.#createDragDropHandlers()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#dragDrop
|
static get TEMPLATES() { return [] }
|
||||||
_sheetMode = this.constructor.SHEET_MODES.PLAY
|
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = {
|
||||||
@ -41,140 +62,30 @@ export default class RdDItemSheet extends HandlebarsApplicationMixin(foundry.app
|
|||||||
window: {
|
window: {
|
||||||
resizable: true,
|
resizable: true,
|
||||||
},
|
},
|
||||||
dragDrop: [{ dragSelector: "[data-drag]", dropSelector: null }],
|
|
||||||
actions: {
|
actions: {
|
||||||
toggleSheet: RdDItemSheet.#onToggleSheet,
|
editImage: RdDItemBaseSheet.#onEditImage,
|
||||||
editImage: RdDItemSheet.#onEditImage,
|
}
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Is the sheet currently in 'Play' mode?
|
|
||||||
* @type {boolean}
|
|
||||||
*/
|
|
||||||
get isPlayMode() {
|
|
||||||
return this._sheetMode === this.constructor.SHEET_MODES.PLAY
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Is the sheet currently in 'Edit' mode?
|
|
||||||
* @type {boolean}
|
|
||||||
*/
|
|
||||||
get isEditMode() {
|
|
||||||
return this._sheetMode === this.constructor.SHEET_MODES.EDIT
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
async _prepareContext() {
|
async _prepareContext() {
|
||||||
const context = {
|
return {
|
||||||
|
item: this.document,
|
||||||
|
options: RdDSheetUtility.getOptions(this.document, this.isEditable),
|
||||||
fields: this.document.schema.fields,
|
fields: this.document.schema.fields,
|
||||||
systemFields: this.document.system.schema.fields,
|
systemFields: this.document.system.schema.fields,
|
||||||
item: this.document,
|
|
||||||
system: this.document.system,
|
system: this.document.system,
|
||||||
source: this.document.toObject(),
|
source: this.document.toObject(),
|
||||||
isEditMode: this.isEditMode,
|
|
||||||
isPlayMode: this.isPlayMode,
|
|
||||||
isEditable: this.isEditable,
|
isEditable: this.isEditable,
|
||||||
}
|
}
|
||||||
return context
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @override */
|
|
||||||
_onRender(context, options) {
|
|
||||||
this.#dragDrop.forEach((d) => d.bind(this.element))
|
|
||||||
}
|
|
||||||
|
|
||||||
// #region Drag-and-Drop Workflow
|
|
||||||
/**
|
|
||||||
* Create drag-and-drop workflow handlers for this Application
|
|
||||||
* @returns {DragDrop[]} An array of DragDrop handlers
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
#createDragDropHandlers() {
|
|
||||||
return this.options.dragDrop.map((d) => {
|
|
||||||
d.permissions = {
|
|
||||||
dragstart: this._canDragStart.bind(this),
|
|
||||||
drop: this._canDragDrop.bind(this),
|
|
||||||
}
|
|
||||||
d.callbacks = {
|
|
||||||
dragstart: this._onDragStart.bind(this),
|
|
||||||
dragover: this._onDragOver.bind(this),
|
|
||||||
drop: this._onDrop.bind(this),
|
|
||||||
}
|
|
||||||
return new DragDrop(d)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define whether a user is able to begin a dragstart workflow for a given drag selector
|
|
||||||
* @param {string} selector The candidate HTML selector for dragging
|
|
||||||
* @returns {boolean} Can the current user drag this selector?
|
|
||||||
* @protected
|
|
||||||
*/
|
|
||||||
_canDragStart(selector) {
|
|
||||||
return this.isEditable
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define whether a user is able to conclude a drag-and-drop workflow for a given drop selector
|
|
||||||
* @param {string} selector The candidate HTML selector for the drop target
|
|
||||||
* @returns {boolean} Can the current user drop on this selector?
|
|
||||||
* @protected
|
|
||||||
*/
|
|
||||||
_canDragDrop(selector) {
|
|
||||||
return this.isEditable && this.document.isOwner
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Callback actions which occur at the beginning of a drag start workflow.
|
|
||||||
* @param {DragEvent} event The originating DragEvent
|
|
||||||
* @protected
|
|
||||||
*/
|
|
||||||
_onDragStart(event) {
|
|
||||||
const el = event.currentTarget
|
|
||||||
if ("link" in event.target.dataset) return
|
|
||||||
|
|
||||||
// Extract the data you need
|
|
||||||
let dragData = null
|
|
||||||
|
|
||||||
if (!dragData) return
|
|
||||||
|
|
||||||
// Set data transfer
|
|
||||||
event.dataTransfer.setData("text/plain", JSON.stringify(dragData))
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Callback actions which occur when a dragged element is over a drop target.
|
|
||||||
* @param {DragEvent} event The originating DragEvent
|
|
||||||
* @protected
|
|
||||||
*/
|
|
||||||
_onDragOver(event) { }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Callback actions which occur when a dragged element is dropped on a target.
|
|
||||||
* @param {DragEvent} event The originating DragEvent
|
|
||||||
* @protected
|
|
||||||
*/
|
|
||||||
async _onDrop(event) { }
|
|
||||||
|
|
||||||
// #endregion
|
|
||||||
|
|
||||||
// #region Actions
|
// #region Actions
|
||||||
/**
|
|
||||||
* Handle toggling between Edit and Play mode.
|
|
||||||
* @param {Event} event The initiating click event.
|
|
||||||
* @param {HTMLElement} target The current target of the event listener.
|
|
||||||
*/
|
|
||||||
static #onToggleSheet(event, target) {
|
|
||||||
const modes = this.constructor.SHEET_MODES
|
|
||||||
this._sheetMode = this.isEditMode ? modes.PLAY : modes.EDIT
|
|
||||||
this.render()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle changing a Document's image.
|
* Handle changing a Document's image.
|
||||||
*
|
*
|
||||||
* @this RdDItemSheet
|
* @this RdDItemBaseSheet
|
||||||
* @param {PointerEvent} event The originating click event
|
* @param {PointerEvent} event The originating click event
|
||||||
* @param {HTMLElement} target The capturing HTML element which defined a [data-action]
|
* @param {HTMLElement} target The capturing HTML element which defined a [data-action]
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
|
@ -1,35 +1,35 @@
|
|||||||
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs";
|
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs";
|
||||||
import { ITEM_TYPES } from "../../constants.js";
|
import { ITEM_TYPES } from "../../constants.js";
|
||||||
import RdDItemSheet from "./common-item-sheet.mjs";
|
import RdDItemBaseSheet from "./common-item-sheet.mjs";
|
||||||
|
|
||||||
|
export default class RdDMonnaieSheet extends RdDItemBaseSheet {
|
||||||
|
|
||||||
export default class RdDMonnaieSheet extends RdDItemSheet {
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static get ITEM_TYPE() { return ITEM_TYPES.monnaie }
|
static get ITEM_TYPE() { return ITEM_TYPES.monnaie }
|
||||||
|
static get TEMPLATES() { return [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE] }
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = Object.assign({},
|
||||||
classes: ["fvtt-rdd", "item", "monnaie"],
|
RdDItemBaseSheet.DEFAULT_OPTIONS,
|
||||||
position: {
|
{
|
||||||
width: 600,
|
classes: ["fvtt-rdd", "item", "monnaie"],
|
||||||
},
|
position: { width: 400 },
|
||||||
window: {
|
window: { contentClasses: ["monnaie-content"] }
|
||||||
contentClasses: ["monnaie-content"],
|
})
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static PARTS = {
|
static PARTS = {
|
||||||
main: {
|
main: {
|
||||||
template: "systems/foundryvtt-reve-de-dragon/templates/item/monnaie.hbs",
|
template: "systems/foundryvtt-reve-de-dragon/templates/sheets/item/monnaie.hbs",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
async _prepareContext() {
|
async _prepareContext() {
|
||||||
const context = await super._prepareContext()
|
return Object.assign(
|
||||||
return Object.assign(context,
|
await super._prepareContext(),
|
||||||
await TEMPLATE_DESCRIPTION.prepareContext(this.item),
|
await TEMPLATE_DESCRIPTION.prepareContext(this.document),
|
||||||
await TEMPLATE_INVENTAIRE.prepareContext(this.item)
|
await TEMPLATE_INVENTAIRE.prepareContext(this.document)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,35 +1,34 @@
|
|||||||
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs";
|
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs";
|
||||||
import { ITEM_TYPES } from "../../constants.js";
|
import { ITEM_TYPES } from "../../constants.js";
|
||||||
import RdDItemSheet from "./common-item-sheet.mjs";
|
import RdDItemBaseSheet from "./common-item-sheet.mjs";
|
||||||
|
|
||||||
export default class RdDMunitionSheet extends RdDItemSheet {
|
export default class RdDMunitionSheet extends RdDItemBaseSheet {
|
||||||
/** @override */
|
/** @override */
|
||||||
static get ITEM_TYPE() { return ITEM_TYPES.munition }
|
static get ITEM_TYPE() { return ITEM_TYPES.munition }
|
||||||
|
static get TEMPLATES() { return [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE] }
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = Object.assign({},
|
||||||
classes: ["fvtt-rdd", "item", "munition"],
|
RdDItemBaseSheet.DEFAULT_OPTIONS,
|
||||||
position: {
|
{
|
||||||
width: 600,
|
classes: ["fvtt-rdd", "item", "munition"],
|
||||||
},
|
position: { width: 400 },
|
||||||
window: {
|
window: { contentClasses: ["munition-content"] }
|
||||||
contentClasses: ["munition-content"],
|
})
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static PARTS = {
|
static PARTS = {
|
||||||
main: {
|
main: {
|
||||||
template: "systems/foundryvtt-reve-de-dragon/templates/item/munition.hbs",
|
template: "systems/foundryvtt-reve-de-dragon/templates/sheets/item/munition.hbs",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
async _prepareContext() {
|
async _prepareContext() {
|
||||||
const context = await super._prepareContext()
|
return Object.assign(
|
||||||
return Object.assign(context,
|
await super._prepareContext(),
|
||||||
await TEMPLATE_DESCRIPTION.prepareContext(this.item),
|
await TEMPLATE_DESCRIPTION.prepareContext(this.document),
|
||||||
await TEMPLATE_INVENTAIRE.prepareContext(this.item)
|
await TEMPLATE_INVENTAIRE.prepareContext(this.document)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
33
module/applications/sheets/tarot-sheet.mjs
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
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: 400 },
|
||||||
|
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)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
@ -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 TextEditor.enrichHTML(context.text, {
|
return await foundry.applications.ux.TextEditor.implementation.enrichHTML(context.text, {
|
||||||
relativeTo: object,
|
relativeTo: object,
|
||||||
secrets: object?.isOwner,
|
secrets: object?.isOwner,
|
||||||
async: true
|
async: true
|
||||||
|
@ -5,7 +5,7 @@ import { RdDUtility } from "../../rdd-utility.js";
|
|||||||
import { RdDAlchimie } from "../../rdd-alchimie.js";
|
import { RdDAlchimie } from "../../rdd-alchimie.js";
|
||||||
import { TextRollManager } from "./text-roll-formatter.js";
|
import { TextRollManager } from "./text-roll-formatter.js";
|
||||||
|
|
||||||
const REGEX_ALCHIMIE_TERMES = "(?<termes>(\\w|-)+)"
|
const REGEX_ALCHIMIE_TERMES = "(?<termes>([-A-Za-zÀ-ÖØ-öø-ÿ ])+)"
|
||||||
const REGEX_ALCHIMIE_MANIP = "(?<manip>(couleur|consistance))"
|
const REGEX_ALCHIMIE_MANIP = "(?<manip>(couleur|consistance))"
|
||||||
const XREGEXP_ROLL_ALCHIMIE = XRegExp("@roll\\[" + REGEX_ALCHIMIE_MANIP + "\\s+" + REGEX_ALCHIMIE_TERMES + "\\]", 'giu')
|
const XREGEXP_ROLL_ALCHIMIE = XRegExp("@roll\\[" + REGEX_ALCHIMIE_MANIP + "\\s+" + REGEX_ALCHIMIE_TERMES + "\\]", 'giu')
|
||||||
const XREGEXP_ROLL_ALCHIMIE_MANIP = XRegExp("@" + REGEX_ALCHIMIE_MANIP + "\\{" + REGEX_ALCHIMIE_TERMES + "\\}", 'giu')
|
const XREGEXP_ROLL_ALCHIMIE_MANIP = XRegExp("@" + REGEX_ALCHIMIE_MANIP + "\\{" + REGEX_ALCHIMIE_TERMES + "\\}", 'giu')
|
||||||
|
@ -5,7 +5,7 @@ import { RdDUtility } from "../../rdd-utility.js";
|
|||||||
import { TextRollManager } from "./text-roll-formatter.js";
|
import { TextRollManager } from "./text-roll-formatter.js";
|
||||||
|
|
||||||
const REGECP_CARAC = "(?<carac>[A-Za-zÀ-ÖØ-öø-ÿ\\s\\-]+)"
|
const REGECP_CARAC = "(?<carac>[A-Za-zÀ-ÖØ-öø-ÿ\\s\\-]+)"
|
||||||
const REGEXP_COMP = "(\\/(?<competence>[A-Za-z0-9À-ÖØ-öø-ÿ -]+))?"
|
const REGEXP_COMP = "(\\/(?<competence>[A-Za-zÀ-ÖØ-öø-ÿ ]+([1-2]?[A-Za-zÀ-ÖØ-öø-ÿ ]+)?))?"
|
||||||
const REGEXP_DIFF = "(/(?<diff>[\\+\\-]?\\d+(d\\d+)?))?"
|
const REGEXP_DIFF = "(/(?<diff>[\\+\\-]?\\d+(d\\d+)?))?"
|
||||||
const REGEXP_ROLL_CARAC_COMP = REGECP_CARAC + REGEXP_COMP + REGEXP_DIFF
|
const REGEXP_ROLL_CARAC_COMP = REGECP_CARAC + REGEXP_COMP + REGEXP_DIFF
|
||||||
const XREGEXP_ROLL_CARAC_COMP = XRegExp("@roll\\[" + REGEXP_ROLL_CARAC_COMP + "\\]", 'giu')
|
const XREGEXP_ROLL_CARAC_COMP = XRegExp("@roll\\[" + REGEXP_ROLL_CARAC_COMP + "\\]", 'giu')
|
||||||
|
@ -10,7 +10,7 @@ import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js";
|
|||||||
export class ChatUtility {
|
export class ChatUtility {
|
||||||
|
|
||||||
static async init() {
|
static async init() {
|
||||||
Hooks.on("renderChatMessage", async (app, html, msg) => await ChatUtility.onRenderChatMessage(app, html, msg))
|
Hooks.on("renderChatMessageHTML", 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))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,7 +62,6 @@ export class ChatUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|
||||||
static removeMessages(socketData) {
|
static removeMessages(socketData) {
|
||||||
if (Misc.isFirstConnectedGM()) {
|
if (Misc.isFirstConnectedGM()) {
|
||||||
ChatUtility.onRemoveMessages(socketData);
|
ChatUtility.onRemoveMessages(socketData);
|
||||||
@ -97,7 +96,7 @@ export class ChatUtility {
|
|||||||
}
|
}
|
||||||
break
|
break
|
||||||
case "gmroll":
|
case "gmroll":
|
||||||
messageData.whisper = ChatUtility.getOwners(actor)
|
messageData.whisper = actor ? ChatUtility.getOwners(actor) : ChatUtility.getUserAndGMs()
|
||||||
break
|
break
|
||||||
case "selfroll":
|
case "selfroll":
|
||||||
messageData.whisper = [game.user]
|
messageData.whisper = [game.user]
|
||||||
@ -108,7 +107,7 @@ export class ChatUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static getOwners(document) {
|
static getOwners(document) {
|
||||||
return game.users.filter(it => document.getUserLevel(it) == CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER)
|
return document ? game.users.filter(it => document.getUserLevel(it) == CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER) : [game.user]
|
||||||
}
|
}
|
||||||
|
|
||||||
static getUserAndGMs() {
|
static getUserAndGMs() {
|
||||||
@ -191,15 +190,15 @@ 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 renderTemplate('systems/foundryvtt-reve-de-dragon/templates/common/date-heure.hbs', timestampData);
|
const dateHeure = await foundry.applications.handlebars.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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async onCreateChatMessage(chatMessage, options, id) {
|
static async onCreateChatMessage(chatMessage, options, id) {
|
||||||
if (chatMessage.isAuthor) {
|
if (chatMessage.isAuthor) {
|
||||||
await chatMessage.setFlag(SYSTEM_RDD, 'rdd-timestamp', game.system.rdd.calendrier.getTimestamp());
|
await chatMessage.setFlag(SYSTEM_RDD, 'rdd-timestamp', game.system.rdd.calendrier.getTimestamp());
|
||||||
await chatMessage.update({ content: await RdDTextEditor.enrichHTML(chatMessage.content, undefined, {showLink:false}) })
|
await chatMessage.update({ content: await RdDTextEditor.enrichHTML(chatMessage.content, undefined, { showLink: false }) })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
@ -4,4 +4,5 @@ import { CommonInventaire } from "./inventaire.mjs";
|
|||||||
export const TEMPLATE_DESCRIPTION = new CommonDescription()
|
export const TEMPLATE_DESCRIPTION = new CommonDescription()
|
||||||
export const TEMPLATE_INVENTAIRE = new CommonInventaire()
|
export const TEMPLATE_INVENTAIRE = new CommonInventaire()
|
||||||
|
|
||||||
|
export const ALL_COMMON_TEMPLATES = [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE]
|
||||||
|
|
||||||
|
@ -4,5 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
export default class CommonTemplate {
|
export default class CommonTemplate {
|
||||||
fields() { }
|
fields() { }
|
||||||
|
handlebars() { return [] }
|
||||||
|
actions() { return {} }
|
||||||
async prepareContext(item) { }
|
async prepareContext(item) { }
|
||||||
}
|
}
|
@ -12,11 +12,21 @@ export class CommonDescription extends CommonTemplate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handlebars() {
|
||||||
|
return [
|
||||||
|
"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-description.hbs",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
actions() {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
|
||||||
async prepareContext(item) {
|
async prepareContext(item) {
|
||||||
return {
|
const enriched = {
|
||||||
description: await RdDTextEditor.enrichHTML(item.system.description, item),
|
description: await RdDTextEditor.enrichHTML(item.system.description, item),
|
||||||
descriptionmj: await RdDTextEditor.enrichHTML(item.system.descriptionmj, item),
|
descriptionmj: await RdDTextEditor.enrichHTML(item.system.descriptionmj, item),
|
||||||
}
|
}
|
||||||
|
return { enriched }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ export const DECIMAL = { required: true, nullable: false, min: 0, integer: false
|
|||||||
export const INTEGER_SIGNED = { required: true, nullable: false, integer: true }
|
export const INTEGER_SIGNED = { required: true, nullable: false, integer: true }
|
||||||
export const DECIMAL_SIGNED = { required: true, nullable: false, integer: false }
|
export const DECIMAL_SIGNED = { required: true, nullable: false, integer: false }
|
||||||
export const STRING = { required: true, nullable: false, blank: true, trim: true }
|
export const STRING = { required: true, nullable: false, blank: true, trim: true }
|
||||||
export const HTMLSTRING = { initial: "", required: true, nullable: false, blank: true, trim: false, textSearch: true }
|
export const HTMLSTRING = { initial: "", required: true, nullable: false, blank: true, textSearch: true }
|
||||||
|
|
||||||
export const MODEL_ARRAY = { initial: [], required: true, nullable: false }
|
export const MODEL_ARRAY = { initial: [], required: true, nullable: false }
|
||||||
|
|
||||||
|
@ -23,6 +23,14 @@ export class CommonInventaire extends CommonTemplate {
|
|||||||
{ label: "Environnement", ...MODEL_ARRAY }),
|
{ label: "Environnement", ...MODEL_ARRAY }),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handlebars() {
|
||||||
|
return [
|
||||||
|
"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-inventaire.hbs"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
async prepareContext(item) {
|
async prepareContext(item) {
|
||||||
|
return {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
export { default as RdDModelMonnaie } from "./monnaie.mjs"
|
export { default as RdDModelMonnaie } from "./monnaie.mjs"
|
||||||
export { default as RdDModelMunition } from "./munition.mjs"
|
export { default as RdDModelMunition } from "./munition.mjs"
|
||||||
|
export { default as RdDModelTarot } from "./tarot.mjs"
|
||||||
|
7
module/documents/tarot.mjs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import { RdDItem } from "../item.js";
|
||||||
|
|
||||||
|
export default class RdDItemTarot extends RdDItem {
|
||||||
|
static get defaultIcon() {
|
||||||
|
return 'systems/foundryvtt-reve-de-dragon/icons/objets/tarot.webp'
|
||||||
|
}
|
||||||
|
}
|
@ -120,13 +120,13 @@ export class RdDItemArme extends Item {
|
|||||||
|
|
||||||
static defenseArmeParade(armeAttaque, armeParade) {
|
static defenseArmeParade(armeAttaque, armeParade) {
|
||||||
const defCategory = RdDItemArme.getCategorieParade(armeParade)
|
const defCategory = RdDItemArme.getCategorieParade(armeParade)
|
||||||
if (defCategory == 'bouclier') {
|
if (defCategory == 'boucliers') {
|
||||||
return 'norm'
|
return 'norm'
|
||||||
}
|
}
|
||||||
if (armeAttaque.system.competence.toLowerCase().match(/(fléau)/)) {
|
if (armeAttaque?.system?.competence?.toLowerCase().match(/(fléau)/)) {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
if (armeParade.system.tir) {
|
if (armeParade.system?.tir) {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
const attCategory = RdDItemArme.getCategorieParade(armeAttaque)
|
const attCategory = RdDItemArme.getCategorieParade(armeAttaque)
|
||||||
|
@ -18,7 +18,7 @@ import { ItemAction } from "./item/item-actions.js";
|
|||||||
/**
|
/**
|
||||||
* Extend the basic ItemSheet for RdD specific items
|
* Extend the basic ItemSheet for RdD specific items
|
||||||
*/
|
*/
|
||||||
export class RdDItemSheetV1 extends ItemSheet {
|
export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet {
|
||||||
|
|
||||||
static get ITEM_TYPE() {
|
static get ITEM_TYPE() {
|
||||||
return undefined
|
return undefined
|
||||||
@ -31,7 +31,7 @@ export class RdDItemSheetV1 extends ItemSheet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static register(sheetClass) {
|
static register(sheetClass) {
|
||||||
Items.registerSheet(SYSTEM_RDD, sheetClass, {
|
foundry.documents.collections.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
|
||||||
@ -100,7 +100,7 @@ export class RdDItemSheetV1 extends 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.options, this.item, this.isEditable),
|
options: RdDSheetUtility.mergeDocumentRights({}, 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),
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,10 @@ export class RdDItemSort extends Item {
|
|||||||
return voies.map(voie => RdDItemCompetence.getVoieDraconic(competencesDraconic, voie))
|
return voies.map(voie => RdDItemCompetence.getVoieDraconic(competencesDraconic, voie))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static getBestDraconicSort(competencesDraconic, sort) {
|
||||||
|
return RdDItemSort.getDraconicsSort(competencesDraconic, sort).sort(Misc.descending(it => it.system.niveau)).find(it=>true)
|
||||||
|
}
|
||||||
|
|
||||||
static getOrdreCode(code) {
|
static getOrdreCode(code) {
|
||||||
return (VOIES_DRACONIC.find(it => it.code == code)?.ordre ?? '?')
|
return (VOIES_DRACONIC.find(it => it.code == code)?.ordre ?? '?')
|
||||||
}
|
}
|
||||||
@ -92,7 +96,7 @@ export class RdDItemSort extends Item {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static isCoutVariable(sort) {
|
static isCoutVariable(sort) {
|
||||||
return sort && (sort.system.ptreve.toLowerCase() == "variable" || sort.system.ptreve.indexOf("+") >= 0);
|
return sort && !Number.isInteger(sort.system.ptreve) && (sort.system.ptreve.toLowerCase() == "variable" || sort.system.ptreve.indexOf("+") >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -55,6 +55,10 @@ 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
|
||||||
}
|
}
|
||||||
|
@ -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) {
|
||||||
|