Compare commits
150 Commits
4dd6e1c3ff
...
v13
Author | SHA1 | Date | |
---|---|---|---|
5b48fda3d0 | |||
abae85157b | |||
da2dca1769 | |||
6e405ea753 | |||
a96f4bf641 | |||
a0f42204d5 | |||
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 | |||
069fef4720 | |||
e32a7d7540 | |||
0773493851 | |||
da982678b7 | |||
c1066d70f6 | |||
5085ba5b54 | |||
f37483a61d | |||
5357e53a5f | |||
764dde6296 | |||
681fbc3177 | |||
70e3e63001 | |||
7ed9a4a12b | |||
acfab362a0 | |||
3d49a3de11 | |||
24518642a7 | |||
d917f80e88 | |||
b29027c61a | |||
6083dd41fa | |||
8969d5e0ed | |||
7d135a214f | |||
9d66a479c4 | |||
800b4a2f32 | |||
9fc21e6d97 | |||
ce7f5381ca | |||
48acdaaca6 | |||
425c6af672 | |||
4281f76dfb | |||
8ebd6ec771 | |||
14391daa0b | |||
ac29e1410e | |||
442ffe9b3a | |||
d922e4fdd5 | |||
a8dc07b4db | |||
40a47ee8a2 | |||
c5633a9fc5 | |||
7e8da49912 | |||
b524716ede | |||
72a9752820 | |||
8e578c6566 | |||
5ac9c682d9 | |||
6de19eb357 | |||
90d096a6df | |||
c733644f3a | |||
de9d3bbb48 | |||
efdffd171c | |||
8406c8434a | |||
a4b474970c | |||
135e5e46a0 | |||
969bc3b573 | |||
a9eb101c9d | |||
d53da1f011 | |||
ab0f7e563f | |||
57c41a0218 | |||
1b75decb18 | |||
551438f514 | |||
792558ac84 | |||
06aff9a3c0 | |||
7e736a00d7 | |||
b87f406093 | |||
785bd4b9ce | |||
daca86b1df | |||
aa52e26e1a | |||
f956da1fc0 | |||
10971e9e7b | |||
a3e6b95ef3 | |||
d0a5a3617c | |||
755df936fb | |||
2fa0ce5f15 | |||
b4eed49e9a | |||
af4404aab1 | |||
85804bc838 | |||
ad4baecdf2 | |||
8dc5616d7c | |||
db6b025e8f | |||
7f53757f26 | |||
879d2d10e5 | |||
016e4463bd | |||
1dfab01c4b | |||
a9cb211dba | |||
4dce510c91 | |||
14abfa8e7d | |||
1f564e0d89 | |||
ab61d5991d | |||
e3a858a9ef | |||
4cacf46ed8 | |||
5a5b5cdbb3 | |||
f90dddfbf8 | |||
d04da56c22 | |||
a87a4d371e | |||
c577fa5f29 | |||
30303330d7 | |||
ded92ddf2d | |||
2d2b75e33f | |||
a9b7dff83a | |||
75d6f78b40 | |||
979d49f96e | |||
22cab26908 | |||
23b3be246b | |||
b160ce78bc | |||
60921cfef1 | |||
12e5c94aba |
@ -12,6 +12,8 @@ jobs:
|
||||
|
||||
#- uses: actions/checkout@v3
|
||||
- uses: RouxAntoine/checkout@v3.5.4
|
||||
with:
|
||||
ref: 'v13'
|
||||
|
||||
# get part of the tag after the `v`
|
||||
- name: Extract tag version number
|
||||
@ -46,7 +48,7 @@ jobs:
|
||||
apt update -y
|
||||
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
|
||||
uses: actions/setup-go@v3
|
||||
@ -69,6 +71,6 @@ jobs:
|
||||
id: 'foundryvtt-reve-de-dragon'
|
||||
version: ${{github.event.release.tag_name}}
|
||||
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'
|
||||
compatibility-minimum: '12'
|
||||
compatibility-verified: '12'
|
||||
notes: 'https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v13/changelog.md'
|
||||
compatibility-minimum: '13'
|
||||
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
|
78
assets/ui/ajout-competence.svg
Normal file
@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
viewBox="0 0 512 512"
|
||||
style="height: 256px; width: 256px;"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
sodipodi:docname="add-skill.svg"
|
||||
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
|
||||
<metadata
|
||||
id="metadata14">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs12" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="2138"
|
||||
inkscape:window-height="1465"
|
||||
id="namedview10"
|
||||
showgrid="false"
|
||||
inkscape:zoom="1.0150849"
|
||||
inkscape:cx="466.02267"
|
||||
inkscape:cy="44.586362"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg8" />
|
||||
<path
|
||||
d="M0 0h512v512H0z"
|
||||
fill="url(#pattern)"
|
||||
fill-opacity="0.5"
|
||||
id="path2" />
|
||||
<g
|
||||
class=""
|
||||
transform="translate(-81.40366,-2.6174234)"
|
||||
id="g6">
|
||||
<path
|
||||
d="m 119.1,25 v 0.1 c -25,3.2 -47.1,32 -47.1,68.8 0,20.4 7.1,38.4 17.5,50.9 L 99.7,157 84,159.9 c -13.7,2.6 -23.8,9.9 -32.2,21.5 -8.5,11.5 -14.9,27.5 -19.4,45.8 -8.2,33.6 -9.9,74.7 -10.1,110.5 h 44 l 11.9,158.4 h 96.3 L 185,337.7 h 41.9 c 0,-36.2 -0.3,-77.8 -7.8,-111.7 -4,-18.5 -10.2,-34.4 -18.7,-45.9 -8.6,-11.4 -19.2,-18.7 -34.5,-21 l -16,-2.5 L 160,144 c 10,-12.5 16.7,-30.2 16.7,-50.1 0,-39.2 -24.8,-68.8 -52.4,-68.8 -2.9,0 -4.7,-0.1 -5.2,-0.1 z M 311,55 v 48 H 208 v 18 h 103 v 158 h -55 v 18 h 55 V 407 H 208 v 18 h 103 v 32 h 80.8 c -0.5,-2.9 -0.8,-5.9 -0.8,-9 0,-3.1 0.3,-6.1 0.8,-9 H 329 V 297 h 62.8 c -0.5,-2.9 -0.8,-5.9 -0.8,-9 0,-3.1 0.3,-6.1 0.8,-9 H 329 V 73 h 62.8 c -0.5,-2.92 -0.8,-5.93 -0.8,-9 0,-3.07 0.3,-6.08 0.8,-9 z m 129,202 c -17.2,0 -31,13.8 -31,31 0,17.2 13.8,31 31,31 17.2,0 31,-13.8 31,-31 0,-17.2 -13.8,-31 -31,-31 z m 0,160 c -17.2,0 -31,13.8 -31,31 0,17.2 13.8,31 31,31 17.2,0 31,-13.8 31,-31 0,-17.2 -13.8,-31 -31,-31 z"
|
||||
fill="#000000"
|
||||
fill-opacity="0.8"
|
||||
transform="matrix(0.6,0,0,0.6,102.4,102.4)"
|
||||
id="path4"
|
||||
sodipodi:nodetypes="ccsccccccccccccccccssccccccccccccccccsccccsccccsccssssssssss" />
|
||||
</g>
|
||||
<g
|
||||
class=""
|
||||
transform="translate(124.63542,-119.78046)"
|
||||
id="g6-1">
|
||||
<path
|
||||
d="m 158.81777,136.77499 c -9.48,32.22 -28.656,28.8 -47.61,26.04 21.39,6.12 29.61,22.38 25.998,47.64 7.596,-27.6 25.572,-31.56 47.652,-26.04 -22.56,-7.26 -34.14,-21.24 -26.04,-47.64 z m -41.76,76.08 c 5.496,10.02 4.578,18.06 -3.366,24 7.476,-4.14 14.91,-8.58 23.946,3.36 -7.542,-9.72 -4.92,-17.4 3.366,-24 -8.352,5.82 -16.482,6.96 -23.946,-3.36 z m 82.32,0.18 c 6.84,16.08 -0.3,24.78 -13.02,30.54 13.62,-5.1 24.48,-2.7 30.54,13.02 -7.62,-19.08 2.88,-24.72 13.02,-30.54 -12.6,5.1 -22.68,0.54 -30.54,-13.02 z m -52.776,31.2 c 9.396,34.68 0.516,58.86 -28.392,71.1 26.076,-7.08 52.428,-15.12 71.208,28.44 -15.84,-35.58 -2.04,-57.24 28.38,-71.28 -30,11.52 -55.86,9 -71.196,-28.26 z"
|
||||
fill="#000000"
|
||||
fill-opacity="0.8"
|
||||
id="path4-2"
|
||||
sodipodi:nodetypes="cccccccccccccccccccc"
|
||||
style="stroke-width:0.6" />
|
||||
</g>
|
||||
</svg>
|
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 |
158
changelog.md
@ -1,8 +1,154 @@
|
||||
# 13.0
|
||||
|
||||
## 13.0.3 - La dernière auberge d'Illysis
|
||||
|
||||
- On peut de nouveau acheter aux commerces
|
||||
- La description des Grizzal a des espaces
|
||||
- Corrections v13
|
||||
- Affichage des images et noms d'objets en ligne
|
||||
- affichage des compétences de créature sur une ligne
|
||||
- Affichage des informations d'acteur sur une ligne dans l'astrologie
|
||||
- Affichage des résultat de recherche
|
||||
|
||||
## 13.0.0 - Le début de l'errance d'Illysis
|
||||
|
||||
- Migration vers la version 13 de Foundry
|
||||
|
||||
# 12.0
|
||||
## 12.0.50 - Le sommeil d'Astrobazzarh
|
||||
- Le don de double rêve n'interrompt plus le sommeil toutes les heures
|
||||
- la perte de fatigue à la descente des TMR est visible immédiatement
|
||||
|
||||
## 12.0.49 - La deuxième lame d'Astrobazzarh
|
||||
- Corrections
|
||||
- les défenses particulières sont correctement affichées
|
||||
- les vieux boucliers (sans catégorie de parade car créés il y a longtemps) peuvent parer...
|
||||
- Les attaques à distance n'ont pas de difficulté libre
|
||||
|
||||
## 12.0.48 - La chèvre d'Astrobazzarh
|
||||
- le Bandersnatch a une protection de 10
|
||||
- la consistance chèvre est maintenant possible dans les recettes
|
||||
alchimiques (et toutes les consistances avec accents)
|
||||
- un échec au lancement d'un sort pour le mettre en réserve brise
|
||||
la concentration du haut-rêvant
|
||||
- Correction: les réussites particulières fonctionnent avec les caractéristiques dérivées
|
||||
|
||||
## 12.0.47
|
||||
- Correction sur les mise à jour en cascade -
|
||||
- Correction sur le force rendering après un changement de competence
|
||||
|
||||
## 12.0.46 - Le double demi d'Astrobazzarh
|
||||
- correction des raffraîchissement lors du sommeil qui empêchait de dormir
|
||||
plusieurs heures
|
||||
- Si la fatigue n'est pas utilisée, les rounds dans les TMR font perdre de l'endurance (au lieu d'en gagner)
|
||||
- les TMRs se ferment correctement quand la fatigue maximale est dépassée
|
||||
- le message de lancement de sort en réserve donne la description du sort
|
||||
- suppression de double-messages lors de la fermeture des TMR
|
||||
|
||||
## 12.0.45 - Les errements d'Astrobazzarh, encore
|
||||
|
||||
- La difficulté des méditations n'augmente plus en cas de réussite et d'échec normal
|
||||
- Renommage du Bouton pour révéler/masquer le demi-rêve
|
||||
|
||||
## 12.0.44 - Les errements d'Astrobazzarh, suite
|
||||
|
||||
- on peut de nouveau dormir et se réveiller reposé
|
||||
- les possessions utilisent maintenant correctement le rêve actuel
|
||||
- les sorts variables ne causent plus de soucis de voie pour le lancement de sorts
|
||||
- les acteurs ayant un sort avec un coût de rêve entier ne sont plus considérés
|
||||
comme pouvant avoir un rêve variable
|
||||
|
||||
## 12.0.42 - Les errements d'Astrobazzarh
|
||||
|
||||
- Correction de différentes automatisations de combat incorrectes
|
||||
- Correction des jets `@roll[vue/-2]` qui tentaient de chercher une compétence -2 (à cause des armes à 1/2 mains)
|
||||
|
||||
## 12.0.41 - La loupe d'Astrobazzarh
|
||||
- On peut de nouveau effectuer des tirages cachés
|
||||
- Le stress transformé est bien diminué lorsqu'on met le stress dans une compétence
|
||||
|
||||
## 12.0.40 - Les mains d'Astrobazzarh
|
||||
- correction des attaques particulières en combat
|
||||
- correction de message sur les min/max liés aux modificateurs de races (s'applique uniquement sur la taille)
|
||||
|
||||
## 12.0.39 - Les mains d'Astrobazzarh
|
||||
- les armes à 1 ou 2 mains fonctionnent dans les liens de jets de dés
|
||||
- commande `/jet` pour poster une demande de jet de dés
|
||||
|
||||
## 12.0.38 - Les prévisions d'Astrobazzarh
|
||||
- Correction de modifications de personnages qui ne s'affichaient pas:
|
||||
- changements d'endurance/vie/fatigue, transformé, ...
|
||||
- Migration des compétences "Ecriture" en "Écriture" dans les tâches, livres, oeuvres et méditations
|
||||
- Correction des jets de compétences de créatures
|
||||
- Premières préparations techniques pour le passage à Founry v13
|
||||
- liste des impacts d'un jet de dés (expérience, points de tâche, ...)
|
||||
- utilisation de l'extension hbs pour tous les fichiers handlebars
|
||||
|
||||
## 12.0.37 - Les enchantements d'Astrobazzarh
|
||||
- les potions ont un état, seules les potions liquides sont enchantables
|
||||
- les lancements de sorts du jour sont conservés jusqu'à chateau dormant
|
||||
- lorsqu'un joueur souhaite enchanter une potion, les sorts d'enchantements/purification/permanence doivent avoir été lancés auparavant
|
||||
- on peut enchanter des gemmes exactement comme des potions
|
||||
|
||||
## 12.0.36 - L'alchimie d'Astrobazzarh
|
||||
- Nouveautés
|
||||
- ajout d'un bouton pour enchanter les potions
|
||||
- standardisation des boutons d'actions sur les items
|
||||
- utilisations d'icones pour les actions de l'inventaire
|
||||
- Corrections:
|
||||
- la commande /tmra sans paramètres fonctionne
|
||||
- les jets d'encaissement depuis le tchat fonctionnent
|
||||
- affichage de la vie/endurance en cas de blessures et remise à neuf
|
||||
- les queues durant 12 heures ajoutées début Vaisseau ne durent plus 24 heures
|
||||
- Compendiums
|
||||
- Corrections des remedes enchantables
|
||||
- Corrections de descriptions pour proposer les jet de dés
|
||||
|
||||
## 12.0.35 - La Solution d'Astrobazzarh
|
||||
- Fix problème d'initialisation des feuilles d'items
|
||||
|
||||
## 12.0.34 - la tête d'Astrobazzarh
|
||||
- support de liens "jets de dés"
|
||||
- on peut ajouter des liens "jet de dés" dans les journaux, descriptions, notes, maladresses, ...
|
||||
- avec la syntaxe `@roll[...]` on peut ajouter le lien vers:
|
||||
- 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 manipulation alchimique `@roll[couleur vert-bleu]`
|
||||
- les liens "jet avec caractéristiques" s'appliquent:
|
||||
- à tous les tokens sélectionnés
|
||||
- sinon, à l'acteur propriétaire (dans le cas d'un Item) ou à l'acteur courant
|
||||
- sinon, au personnage du joueur
|
||||
- on peut poster les liens dans le tchat pour proposer un jet aux joueurs
|
||||
- gestion des blocs secrets dans les descriptions
|
||||
|
||||
## 12.0.33 - la vieillesse d'Astrobazzarh
|
||||
- retour de l'expérience pour les joueurs
|
||||
- suppression du message "Pas de caractéristique" sur les jets d'odorat-goût
|
||||
|
||||
## 12.0.32 - les rêveries d'Astrobazzarh
|
||||
- Ajout des Items Race pour gérer les ajustements liés aux races
|
||||
|
||||
## 12.0.31 - le mausolée d'Astrobazzarh
|
||||
- Correction: les automatisation de combat jouer-MJ fonctionnentde nouveau
|
||||
|
||||
## 12.0.30 - le cauchemar d'Astrobazzarh
|
||||
- calcul automatique du niveau des entités selon leur rêve
|
||||
- la description des créatures venimeuses contient un lien vers leur venin
|
||||
- Correction: les messages de combats ne marchaient plus (Changement combiné Foundry + rêve de Dragon)
|
||||
|
||||
## 12.0.29 - L'indexation d'Astrobazzarh
|
||||
- les liens dans la descriptions des sorts pointent vers les sorts du compendium
|
||||
- la description du chrasme contient le lien vers son venin plutôt qu'un tableau
|
||||
|
||||
## 12.0.28 - Les réserves d'Astrobazzarh
|
||||
- possibilité de mettre en réserve depuis un sort connu
|
||||
|
||||
## 12.0.27 - Les vêtements d'Astrobazzarh
|
||||
- Ajout de la liste des armures dans l'onglet caractéristiques
|
||||
- Ajout d'une option pour choisir une carte des TMR alternatives
|
||||
- Le Gardien peut créer des sorts en réserve parmi les sorts d'un personnage
|
||||
- Bouton pour ajouter des compétences aux créatures/entités
|
||||
- Bouton pour ajouter un personnage accordé aux entités de cauchemar
|
||||
- Correction du choix d'une cible parmi toutes les cibles pour les combats
|
||||
- Correction des ajouts de blessures (prise en compte de l'endurance et des contusions)
|
||||
- Correction des rituels de Détection et Lecture d'Aura des personnages prétirés
|
||||
@ -11,6 +157,11 @@
|
||||
- ajout de lien entre le sort et la créature
|
||||
- correction des liens vers les journaux
|
||||
- limitation aux compétences listées
|
||||
- acteur non lié par défaut
|
||||
- Correction des compendiums
|
||||
- l'import de personnages depuis un compendium respecte les acteurs liés/non-liés
|
||||
- les modèles de voyageurs sont liés par défaut
|
||||
- les modèles de personnages non joueurs sont non-liés par défaut
|
||||
|
||||
## 12.0.26 - Astrobazzarh le Haut-rêvant
|
||||
- bouton pour le don de haut-rêve en un clic
|
||||
@ -108,11 +259,9 @@
|
||||
- encodage de l'export en windows-1252
|
||||
- export de l'esquive avec armure et sans armure
|
||||
|
||||
## 12.0.10 - Le scriptorium d'Astrobazzarh
|
||||
## 12.0.9 - 12.0.10 - Le scriptorium d'Astrobazzarh
|
||||
- corrections de l'export scriptarium
|
||||
|
||||
## 12.0.9 - Le scriptorium d'Astrobazzarh
|
||||
- ajout d'une fonction avancée pour exporter les personnages dans un format csv
|
||||
- ajout d'une fonction avancée pour un exporter "scriptarium" des personnages
|
||||
|
||||
## 12.0.8 - La quincaillerie d'Astrobazzarh
|
||||
- le propriétaire est indiqué dans les feuilles d'équipements/compétences/...
|
||||
@ -469,4 +618,3 @@ Vu qu'elles ne peuvent pas être utilisées, permet de savoir pourquoi
|
||||
- correction des achats par le MJ sans acteur sélectionné
|
||||
|
||||
Cf branche v10 pour l'historique des versions 10
|
||||
|
||||
|
2473
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", "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;
|
BIN
icons/humanoides/humain.webp
Normal file
After Width: | Height: | Size: 6.3 KiB |
@ -40,6 +40,7 @@
|
||||
"possession": "Possession",
|
||||
"potion": "Potion",
|
||||
"queue": "Queue de Dragon",
|
||||
"race": "Race",
|
||||
"recettealchimique": "Recette alchimique",
|
||||
"recettecuisine": "Recette de cuisine",
|
||||
"rencontre": "Rencontre TMR",
|
||||
|
50
less/colors.less
Normal file
@ -0,0 +1,50 @@
|
||||
: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);
|
||||
}
|
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 */
|
||||
}
|
2100
less/foundryvtt-reve-de-dragon.less
Normal file
7
less/item/monnaie.less
Normal file
@ -0,0 +1,7 @@
|
||||
// Styles pour la feuille d'objet Monnaie
|
||||
.monnaie-content {
|
||||
|
||||
.item-sheet-common();
|
||||
.item-sheet-header();
|
||||
|
||||
}
|
7
less/item/munition.less
Normal file
@ -0,0 +1,7 @@
|
||||
// Styles pour la feuille d'objet Monnaie
|
||||
.munition-content {
|
||||
|
||||
.item-sheet-common();
|
||||
.item-sheet-header();
|
||||
|
||||
}
|
7
less/item/tarot.less
Normal file
@ -0,0 +1,7 @@
|
||||
// Styles pour la feuille d'objet Monnaie
|
||||
.tarot-content {
|
||||
|
||||
.item-sheet-common();
|
||||
.item-sheet-header();
|
||||
|
||||
}
|
108
less/sheets.less
Normal file
@ -0,0 +1,108 @@
|
||||
.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;
|
||||
}
|
||||
}
|
@ -44,13 +44,13 @@ export class ChatVente {
|
||||
vente.nbLots = Math.max(0, vente.nbLots - quantite)
|
||||
await chatMessage.setFlag(SYSTEM_RDD, NB_LOTS, vente.nbLots)
|
||||
|
||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.html', vente);
|
||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.hbs', vente);
|
||||
chatMessage.update({ content: html });
|
||||
chatMessage.render(true);
|
||||
}
|
||||
|
||||
static async displayAchatVente(vente) {
|
||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.html', vente);
|
||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.hbs', vente);
|
||||
const chatMessage = await ChatMessage.create(RdDUtility.chatDataSetup(html))
|
||||
await chatMessage.setFlag(SYSTEM_RDD, NB_LOTS, vente.nbLots)
|
||||
await chatMessage.setFlag(SYSTEM_RDD, DETAIL_VENTE, {
|
||||
|
@ -29,7 +29,7 @@ export class DialogItemAchat extends Dialog {
|
||||
}
|
||||
|
||||
DialogItemAchat.changeNombreLots(venteData, 1)
|
||||
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-achat.html`, venteData)
|
||||
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-achat.hbs`, venteData)
|
||||
new DialogItemAchat(html, venteData).render(true)
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ export class DialogItemVente extends Dialog {
|
||||
quantiteIllimite: item.isItemCommerce() ? quantiteMax == undefined : !item.parent,
|
||||
isOwned: item.parent,
|
||||
}
|
||||
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-vente.html`, venteData);
|
||||
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-vente.hbs`, venteData);
|
||||
return new DialogItemVente(venteData, html).render(true);
|
||||
}
|
||||
|
||||
|
@ -12,12 +12,14 @@ import { RdDSheetUtility } from "./rdd-sheet-utility.js";
|
||||
import { STATUSES } from "./settings/status-effects.js";
|
||||
import { MAINS_DIRECTRICES } from "./actor.js";
|
||||
import { RdDBaseActorReveSheet } from "./actor/base-actor-reve-sheet.js";
|
||||
import { ITEM_TYPES } from "./constants.js";
|
||||
import { RdDItem } from "./item.js";
|
||||
import { RdDItemBlessure } from "./item/blessure.js";
|
||||
import { RdDEmpoignade } from "./rdd-empoignade.js";
|
||||
import { RdDBaseActorSangSheet } from "./actor/base-actor-sang-sheet.js";
|
||||
import { RdDCoeur } from "./coeur/rdd-coeur.js";
|
||||
import { AppPersonnageAleatoire } from "./actor/random/app-personnage-aleatoire.js";
|
||||
import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/**
|
||||
@ -28,7 +30,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return foundry.utils.mergeObject(RdDBaseActorReveSheet.defaultOptions, {
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-sheet.html",
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-sheet.hbs",
|
||||
width: 550,
|
||||
showCompNiveauBase: false,
|
||||
vueArchetype: false,
|
||||
@ -43,8 +45,8 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
limited: this.actor.limited,
|
||||
owner: this.actor.isOwner,
|
||||
biographie: await TextEditor.enrichHTML(this.actor.system.biographie, { async: true }),
|
||||
notes: await TextEditor.enrichHTML(this.actor.system.notes, { async: true }),
|
||||
biographie: await RdDTextEditor.enrichHTML(this.actor.system.biographie, this.actor),
|
||||
notes: await RdDTextEditor.enrichHTML(this.actor.system.notes, this.actor),
|
||||
});
|
||||
foundry.utils.mergeObject(formData.calc, {
|
||||
surenc: this.actor.computeMalusSurEncombrement(),
|
||||
@ -97,6 +99,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
cacheTMR: this.actor.isTMRCache()
|
||||
}
|
||||
|
||||
formData.race = actor.itemTypes[ITEM_TYPES.race].find(it => true)
|
||||
formData.subacteurs = {
|
||||
vehicules: this.actor.listeVehicules(),
|
||||
montures: this.actor.listeMontures(),
|
||||
@ -123,80 +126,73 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
})
|
||||
|
||||
this.html.find('.show-hide-competences').click(async event => {
|
||||
this.options.showCompNiveauBase = !this.options.showCompNiveauBase;
|
||||
this.render(true);
|
||||
this.options.showCompNiveauBase = !this.options.showCompNiveauBase
|
||||
this.render(true)
|
||||
});
|
||||
|
||||
this.html.find('.button-tmr-visu').click(async event => this.actor.displayTMR("visu"))
|
||||
this.html.find('.button-tmr-visu').click(async event => await this.actor.displayTMR("visu"))
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
this.html.find('.sheet-possession-attack').click(async event => {
|
||||
const poss = RdDSheetUtility.getItem(event, this.actor)
|
||||
this.actor.conjurerPossession(poss)
|
||||
await this.actor.conjurerPossession(poss)
|
||||
})
|
||||
|
||||
this.html.find('.subacteur-coeur-toggle a').click(async event => {
|
||||
const subActorIdactorId = RdDSheetUtility.getEventItemData(event, 'subactor-id')
|
||||
const coeurNombre = $(event.currentTarget).data('numero-coeur')
|
||||
RdDCoeur.toggleSubActeurCoeur(this.actor.id, subActorIdactorId, coeurNombre)
|
||||
await RdDCoeur.toggleSubActeurCoeur(this.actor.id, subActorIdactorId, coeurNombre)
|
||||
})
|
||||
this.html.find('.subacteur-tendre-moment').click(async event => {
|
||||
const subActorId = RdDSheetUtility.getEventItemData(event, 'subactor-id')
|
||||
RdDCoeur.startSubActeurTendreMoment(this.actor.id, subActorId)
|
||||
await RdDCoeur.startSubActeurTendreMoment(this.actor.id, subActorId)
|
||||
})
|
||||
this.html.find('.subacteur-delete').click(async event => {
|
||||
const li = RdDSheetUtility.getEventElement(event);
|
||||
const subActorId = li.data("subactor-id");
|
||||
this.deleteSubActeur(subActorId, li);
|
||||
})
|
||||
this.html.find("input.derivee-value[name='system.compteurs.stress.value']").change(async event => {
|
||||
this.actor.updateCompteurValue("stress", parseInt(event.target.value));
|
||||
});
|
||||
this.html.find("input.derivee-value[name='system.compteurs.experience.value']").change(async event => {
|
||||
this.actor.updateCompteurValue("experience", parseInt(event.target.value));
|
||||
});
|
||||
this.html.find("input.derivee-value[name='system.compteurs.stress.value']").change(async event =>
|
||||
await this.actor.updateCompteurValue("stress", parseInt(event.target.value))
|
||||
);
|
||||
this.html.find("input.derivee-value[name='system.compteurs.experience.value']").change(async event =>
|
||||
await this.actor.updateCompteurValue("experience", parseInt(event.target.value))
|
||||
);
|
||||
|
||||
this.html.find('.creer-tache').click(async event => this.createEmptyTache());
|
||||
this.html.find('.creer-une-oeuvre').click(async event => this.selectTypeOeuvreToCreate());
|
||||
this.html.find('.creer-tache-blessure-legere').click(async event => RdDItemBlessure.createTacheSoinBlessure(this.actor, 2));
|
||||
this.html.find('.creer-tache-blessure-grave').click(async event => RdDItemBlessure.createTacheSoinBlessure(this.actor, 4));
|
||||
this.html.find('.creer-tache-blessure-critique').click(async event => RdDItemBlessure.createTacheSoinBlessure(this.actor, 6));
|
||||
this.html.find('.creer-tache').click(async event => await this.createEmptyTache());
|
||||
this.html.find('.creer-une-oeuvre').click(async event => await this.selectTypeOeuvreToCreate());
|
||||
this.html.find('.creer-tache-blessure-legere').click(async event => await RdDItemBlessure.createTacheSoinBlessure(this.actor, 2));
|
||||
this.html.find('.creer-tache-blessure-grave').click(async event => await RdDItemBlessure.createTacheSoinBlessure(this.actor, 4));
|
||||
this.html.find('.creer-tache-blessure-critique').click(async event => await RdDItemBlessure.createTacheSoinBlessure(this.actor, 6));
|
||||
|
||||
this.html.find('.blessure-premierssoins-done').change(async event => {
|
||||
const blessure = this.getBlessure(event);
|
||||
await blessure?.setSoinsBlessure({ premierssoins: { done: event.currentTarget.checked } });
|
||||
await this.getBlessure(event)?.setSoinsBlessure({ premierssoins: { done: event.currentTarget.checked } });
|
||||
});
|
||||
this.html.find('.blessure-soinscomplets-done').change(async event => {
|
||||
const blessure = this.getBlessure(event);
|
||||
await blessure?.setSoinsBlessure({ soinscomplets: { done: event.currentTarget.checked } })
|
||||
await this.getBlessure(event)?.setSoinsBlessure({ soinscomplets: { done: event.currentTarget.checked } })
|
||||
});
|
||||
this.html.find('.blessure-premierssoins-bonus').change(async event => {
|
||||
const blessure = this.getBlessure(event);
|
||||
await blessure?.setSoinsBlessure({ premierssoins: { bonus: Number(event.currentTarget.value) } })
|
||||
await this.getBlessure(event)?.setSoinsBlessure({ premierssoins: { bonus: Number(event.currentTarget.value) } })
|
||||
});
|
||||
this.html.find('.blessure-soinscomplets-bonus').change(async event => {
|
||||
const blessure = this.getBlessure(event);
|
||||
await blessure?.setSoinsBlessure({ soinscomplets: { bonus: Number(event.currentTarget.value) } })
|
||||
await this.getBlessure(event)?.setSoinsBlessure({ soinscomplets: { bonus: Number(event.currentTarget.value) } })
|
||||
});
|
||||
|
||||
// Equip Inventory Item
|
||||
this.html.find('.item-equip').click(async event => this.actor.equiperObjet(RdDSheetUtility.getItemId(event)))
|
||||
this.html.find('.chance-actuelle').click(async event => this.actor.rollCarac('chance-actuelle'))
|
||||
this.html.find('.roll-chance-actuelle').click(async event => await this.actor.rollCarac('chance-actuelle'))
|
||||
this.html.find('.button-appel-chance').click(async event => await this.actor.rollAppelChance())
|
||||
|
||||
this.html.find('.button-appel-chance').click(async event => this.actor.rollAppelChance())
|
||||
this.html.find('[name="jet-astrologie"]').click(async event => await this.actor.astrologieNombresAstraux())
|
||||
this.html.find('.action-tache').click(async event => await this.actor.rollTache(RdDSheetUtility.getItemId(event)))
|
||||
this.html.find('.meditation-label a').click(async event => await this.actor.rollMeditation(RdDSheetUtility.getItemId(event)))
|
||||
|
||||
this.html.find('[name="jet-astrologie"]').click(async event => this.actor.astrologieNombresAstraux())
|
||||
this.html.find('.tache-label a').click(async event => this.actor.rollTache(RdDSheetUtility.getItemId(event)))
|
||||
this.html.find('.meditation-label a').click(async event => this.actor.rollMeditation(RdDSheetUtility.getItemId(event)))
|
||||
|
||||
this.html.find('.chant-label a').click(async event => this.actor.rollChant(RdDSheetUtility.getItemId(event)))
|
||||
this.html.find('.danse-label a').click(async event => this.actor.rollDanse(RdDSheetUtility.getItemId(event)))
|
||||
this.html.find('.musique-label a').click(async event => this.actor.rollMusique(RdDSheetUtility.getItemId(event)))
|
||||
this.html.find('.oeuvre-label a').click(async event => this.actor.rollOeuvre(RdDSheetUtility.getItemId(event)))
|
||||
this.html.find('.jeu-label a').click(async event => this.actor.rollJeu(RdDSheetUtility.getItemId(event)))
|
||||
this.html.find('.recettecuisine-label a').click(async event => this.actor.rollRecetteCuisine(RdDSheetUtility.getItemId(event)))
|
||||
this.html.find('.action-chant').click(async event => await this.actor.rollChant(RdDSheetUtility.getItemId(event)))
|
||||
this.html.find('.action-danse').click(async event => await this.actor.rollDanse(RdDSheetUtility.getItemId(event)))
|
||||
this.html.find('.action-musique').click(async event => await this.actor.rollMusique(RdDSheetUtility.getItemId(event)))
|
||||
this.html.find('.action-oeuvre').click(async event => await this.actor.rollOeuvre(RdDSheetUtility.getItemId(event)))
|
||||
this.html.find('.action-jeu').click(async event => await this.actor.rollJeu(RdDSheetUtility.getItemId(event)))
|
||||
this.html.find('.action-recettecuisine').click(async event => await this.actor.rollRecetteCuisine(RdDSheetUtility.getItemId(event)))
|
||||
|
||||
this.html.find('.description-aleatoire').click(async event => new AppPersonnageAleatoire(this.actor).render(true))
|
||||
if (game.user.isGM) {
|
||||
@ -212,17 +208,16 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
await this.actor.deleteExperienceLog(0, key + 1);
|
||||
});
|
||||
// Boutons spéciaux MJs
|
||||
this.html.find('.forcer-tmr-aleatoire').click(async event => this.actor.reinsertionAleatoire("Action MJ"))
|
||||
this.html.find('.don-de-haut-reve').click(async event => this.actor.addDonDeHautReve())
|
||||
this.html.find('.nouveau-sort-reserve').click(async event => this.actor.addSortReserve())
|
||||
this.html.find('.afficher-tmr').click(async event => this.actor.changeTMRVisible())
|
||||
this.html.find('.forcer-tmr-aleatoire').click(async event => await this.actor.reinsertionAleatoire("Action MJ"))
|
||||
this.html.find('.don-de-haut-reve').click(async event => await this.actor.addDonDeHautReve())
|
||||
this.html.find('.afficher-tmr').click(async event => await this.actor.changeTMRVisible())
|
||||
}
|
||||
|
||||
// Points de reve actuel
|
||||
this.html.find('.roll-reve-actuel').click(async event => this.actor.rollCarac('reve-actuel', true))
|
||||
this.html.find('.empoignade-label a').click(async event => RdDEmpoignade.onAttaqueEmpoignadeFromItem(RdDSheetUtility.getItem(event, this.actor)))
|
||||
this.html.find('.roll-reve-actuel').click(async event => await this.actor.rollCarac('reve-actuel', { resistance: true }))
|
||||
this.html.find('.action-empoignade').click(async event => await RdDEmpoignade.onAttaqueEmpoignadeFromItem(RdDSheetUtility.getItem(event, this.actor)))
|
||||
|
||||
this.html.find('.roll-arme').click(async event => this.actor.rollArme(foundry.utils.duplicate(this._getEventArmeCombat(event)), 'competence'))
|
||||
this.html.find('.roll-arme').click(async event => await this.actor.rollArme(foundry.utils.duplicate(this._getEventArmeCombat(event)), 'competence'))
|
||||
|
||||
// Initiative pour l'arme
|
||||
this.html.find('.roll-init-arme').click(async event => {
|
||||
@ -235,30 +230,34 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
})
|
||||
// Display TMR
|
||||
|
||||
this.html.find('.button-tmr').click(async event => this.actor.displayTMR("normal"))
|
||||
this.html.find('.button-tmr-rapide').click(async event => this.actor.displayTMR("rapide"))
|
||||
this.html.find('.button-tmr').click(async event => await this.actor.displayTMR("normal"))
|
||||
this.html.find('.button-tmr-rapide').click(async event => await this.actor.displayTMR("rapide"))
|
||||
|
||||
this.html.find('.button-repos').click(async event => await this.actor.repos())
|
||||
|
||||
this.html.find('.carac-xp-augmenter').click(async event => this.actor.updateCaracXPAuto(event.currentTarget.name.replace("augmenter.", "")))
|
||||
this.html.find('.competence-xp-augmenter').click(async event => this.actor.updateCompetenceXPAuto(RdDSheetUtility.getItemId(event)))
|
||||
this.html.find('.competence-stress-augmenter').click(async event => this.actor.updateCompetenceStress(RdDSheetUtility.getItemId(event)))
|
||||
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-stress-augmenter').click(async event =>{
|
||||
await this.actor.updateCompetenceStress(RdDSheetUtility.getItemId(event))
|
||||
this.render(true)
|
||||
}
|
||||
)
|
||||
|
||||
if (this.options.vueDetaillee) {
|
||||
// On carac change
|
||||
this.html.find('input.carac-xp').change(async event => {
|
||||
let caracName = event.currentTarget.name.replace(".xp", "").replace("system.carac.", "");
|
||||
this.actor.updateCaracXP(caracName, parseInt(event.target.value));
|
||||
});
|
||||
let caracName = event.currentTarget.name.replace(".xp", "").replace("system.carac.", "")
|
||||
await this.actor.updateCaracXP(caracName, parseInt(event.target.value))
|
||||
})
|
||||
// On competence xp change
|
||||
this.html.find('input.competence-xp').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
this.actor.updateCompetenceXP(compName, parseInt(event.target.value));
|
||||
});
|
||||
let compName = event.currentTarget.attributes.compname.value
|
||||
await this.actor.updateCompetenceXP(compName, parseInt(event.target.value))
|
||||
})
|
||||
this.html.find('input.competence-xp-sort').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
this.actor.updateCompetenceXPSort(compName, parseInt(event.target.value));
|
||||
});
|
||||
let compName = event.currentTarget.attributes.compname.value
|
||||
await this.actor.updateCompetenceXPSort(compName, parseInt(event.target.value))
|
||||
})
|
||||
|
||||
this.html.find('.toggle-archetype').click(async event => {
|
||||
this.options.vueArchetype = !this.options.vueArchetype;
|
||||
@ -267,25 +266,27 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
// On competence archetype change
|
||||
this.html.find('.competence-archetype').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
this.actor.updateCompetenceArchetype(compName, parseInt(event.target.value));
|
||||
await this.actor.updateCompetenceArchetype(compName, parseInt(event.target.value));
|
||||
});
|
||||
this.html.find('.nouvelle-incarnation').click(async event => this.actor.nouvelleIncarnation())
|
||||
this.html.find('.nouvelle-incarnation').click(async event => await this.actor.nouvelleIncarnation())
|
||||
}
|
||||
|
||||
// On pts de reve change
|
||||
this.html.find('.pointsreve-value').change(async event => this.actor.update({ "system.reve.reve.value": event.currentTarget.value }))
|
||||
this.html.find('.seuil-reve-value').change(async event => this.actor.setPointsDeSeuil(event.currentTarget.value))
|
||||
this.html.find('.pointsreve-value').change(async event => await this.actor.update({ "system.reve.reve.value": event.currentTarget.value }))
|
||||
this.html.find('.seuil-reve-value').change(async event => await this.actor.setPointsDeSeuil(event.currentTarget.value))
|
||||
|
||||
this.html.find('.stress-test').click(async event => this.actor.transformerStress())
|
||||
this.html.find('.moral-malheureux').click(async event => this.actor.jetDeMoral('malheureuse'))
|
||||
this.html.find('.moral-neutre').click(async event => this.actor.jetDeMoral('neutre'))
|
||||
this.html.find('.moral-heureux').click(async event => this.actor.jetDeMoral('heureuse'))
|
||||
this.html.find('.button-ethylisme').click(async event => this.actor.jetEthylisme())
|
||||
this.html.find('.stress-test').click(async event => await this.actor.transformerStress())
|
||||
this.html.find('.moral-malheureux').click(async event => await this.actor.jetDeMoral('malheureuse'))
|
||||
this.html.find('.moral-neutre').click(async event => await this.actor.jetDeMoral('neutre'))
|
||||
this.html.find('.moral-heureux').click(async event => await this.actor.jetDeMoral('heureuse'))
|
||||
this.html.find('.button-ethylisme').click(async event => await this.actor.jetEthylisme())
|
||||
|
||||
this.html.find('.ptreve-actuel-plus').click(async event => this.actor.reveActuelIncDec(1))
|
||||
this.html.find('.ptreve-actuel-moins').click(async event => this.actor.reveActuelIncDec(-1))
|
||||
this.html.find('.fatigue-plus').click(async event => this.actor.santeIncDec("fatigue", 1))
|
||||
this.html.find('.fatigue-moins').click(async event => this.actor.santeIncDec("fatigue", -1))
|
||||
this.html.find('.ptreve-actuel-plus').click(async event => await this.actor.reveActuelIncDec(1))
|
||||
this.html.find('.ptreve-actuel-moins').click(async event => await this.actor.reveActuelIncDec(-1))
|
||||
this.html.find('.chance-actuelle-plus').click(async event => await this.actor.chanceActuelleIncDec(1))
|
||||
this.html.find('.chance-actuelle-moins').click(async event => await this.actor.chanceActuelleIncDec(-1))
|
||||
this.html.find('.fatigue-plus').click(async event => await this.actor.santeIncDec("fatigue", 1))
|
||||
this.html.find('.fatigue-moins').click(async event => await this.actor.santeIncDec("fatigue", -1))
|
||||
}
|
||||
|
||||
getBlessure(event) {
|
||||
@ -322,7 +323,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
/* -------------------------------------------- */
|
||||
async selectTypeOeuvreToCreate() {
|
||||
let types = RdDItem.getTypesOeuvres();
|
||||
let content = `<span class="competence-label">Selectionnez le type d'oeuvre</span><select class="item-type">`;
|
||||
let content = `<span class="generic-label">Selectionnez le type d'oeuvre</span><select class="item-type">`;
|
||||
for (let typeName of types) {
|
||||
content += `<option value="${typeName}">${Misc.typeName('Item', typeName)}</option>`
|
||||
}
|
||||
|
654
module/actor.js
@ -1,4 +1,6 @@
|
||||
import { RdDTextEditor } from "../apps/rdd-text-roll-editor.js";
|
||||
import { Grammar } from "../grammar.js";
|
||||
import { ITEM_TYPES } from "../constants.js";
|
||||
import { RdDSheetUtility } from "../rdd-sheet-utility.js";
|
||||
import { RdDBaseActorSheet } from "./base-actor-sheet.js";
|
||||
|
||||
@ -24,19 +26,45 @@ export class RdDBaseActorReveSheet extends RdDBaseActorSheet {
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
this.html.find('.button-encaissement').click(async event => this.actor.encaisser())
|
||||
this.html.find('.button-encaissement').click(async event => await this.actor.encaisser())
|
||||
this.html.find('.roll-carac').click(async event => {
|
||||
this.actor.rollCarac(Grammar.toLowerCaseNoAccent(event.currentTarget.attributes['data-carac-name'].value))});
|
||||
this.html.find('.roll-competence').click(async event => this.actor.rollCompetence(RdDSheetUtility.getItemId(event)));
|
||||
this.html.find('.endurance-plus').click(async event => this.actor.santeIncDec("endurance", 1));
|
||||
this.html.find('.endurance-moins').click(async event => this.actor.santeIncDec("endurance", -1));
|
||||
await this.actor.rollCarac(Grammar.toLowerCaseNoAccent(event.currentTarget.attributes['data-carac-name'].value))
|
||||
})
|
||||
this.html.find('.roll-competence').click(async event => await this.actor.rollCompetence(RdDSheetUtility.getItemId(event)));
|
||||
this.html.find('.endurance-plus').click(async event => await this.actor.santeIncDec("endurance", 1));
|
||||
this.html.find('.endurance-moins').click(async event => await this.actor.santeIncDec("endurance", -1));
|
||||
|
||||
if (game.user.isGM) {
|
||||
this.html.find('.button-remise-a-neuf').click(async event => this.actor.remiseANeuf())
|
||||
this.html.find('.delete-active-effect').click(async event => this.actor.removeEffect(this.html.find(event.currentTarget).parents(".active-effect").data('effect')));
|
||||
this.html.find('.button-remise-a-neuf').click(async event => await this.actor.remiseANeuf())
|
||||
this.html.find('.delete-active-effect').click(async event => await this.actor.removeEffect(this.html.find(event.currentTarget).parents(".active-effect").data('effect')));
|
||||
this.html.find('.enlever-tous-effets').click(async event => await this.actor.removeEffects());
|
||||
}
|
||||
this.html.find('.competence-add').click(async event =>
|
||||
await this.actor.createEmbeddedDocuments("Item", [{
|
||||
type: ITEM_TYPES.competencecreature,
|
||||
name: 'Nouvelle competence',
|
||||
img: 'systems/foundryvtt-reve-de-dragon/icons/compcreature-serres.webp',
|
||||
system: {
|
||||
carac_value: this.actor.getForce(),
|
||||
}
|
||||
}], { renderSheet: true })
|
||||
)
|
||||
this.html.find('.roll-text').click(async event => await RdDTextEditor.rollText(event, this.actor))
|
||||
this.html.find('.chat-roll-text').click(async event => await RdDTextEditor.chatRollText(event))
|
||||
|
||||
|
||||
if (this.options.vueDetaillee) {
|
||||
// On carac change
|
||||
this.html.find('.carac-value').change(async event => {
|
||||
let caracName = event.currentTarget.name.replace(".value", "").replace("system.carac.", "")
|
||||
await this.actor.updateCarac(caracName, parseInt(event.target.value))
|
||||
});
|
||||
// On competence change
|
||||
this.html.find('.competence-value').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value
|
||||
await this.actor.updateCompetence(compName, parseInt(event.target.value))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import { RdDRoll } from "../rdd-roll.js";
|
||||
import { RdDUtility } from "../rdd-utility.js";
|
||||
import { ReglesOptionnelles } from "../settings/regles-optionnelles.js";
|
||||
import { RdDBaseActor } from "./base-actor.js";
|
||||
import { ITEM_TYPES } from "../item.js";
|
||||
import { ITEM_TYPES } from "../constants.js";
|
||||
import { RdDItemCompetence } from "../item-competence.js";
|
||||
import { RdDItemCompetenceCreature } from "../item-competencecreature.js";
|
||||
import { RdDItemArme } from "../item-arme.js";
|
||||
@ -15,6 +15,7 @@ import { StatusEffects } from "../settings/status-effects.js";
|
||||
import { Targets } from "../targets.js";
|
||||
import { RdDConfirm } from "../rdd-confirm.js";
|
||||
import { RdDCarac } from "../rdd-carac.js";
|
||||
import { RdDRollResult } from "../rdd-roll-result.js";
|
||||
|
||||
import { ChatUtility } from "../chat-utility.js";
|
||||
import { DialogValidationEncaissement } from "../dialog-validation-encaissement.js";
|
||||
@ -22,6 +23,7 @@ import { RdDCombat } from "../rdd-combat.js";
|
||||
import { RdDEmpoignade } from "../rdd-empoignade.js";
|
||||
import { RdDPossession } from "../rdd-possession.js";
|
||||
import { BASE_CORPS_A_CORPS, BASE_ESQUIVE, POSSESSION_SANS_DRACONIC } from "../item/base-items.js";
|
||||
import { RollDataAjustements } from "../rolldata-ajustements.js";
|
||||
|
||||
/**
|
||||
* Classe de base pour les acteurs disposant de rêve (donc, pas des objets)
|
||||
@ -37,6 +39,15 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
this.system.sante.endurance.value = Math.min(this.system.sante.endurance.value, this.system.sante.endurance.max)
|
||||
}
|
||||
|
||||
getCarac() {
|
||||
return foundry.utils.mergeObject(this.system.carac,
|
||||
{
|
||||
'reve-actuel': this.getCaracReveActuel(),
|
||||
'chance-actuelle': this.getCaracChanceActuelle()
|
||||
},
|
||||
{ inplace: false })
|
||||
}
|
||||
|
||||
getCaracChanceActuelle() {
|
||||
return {
|
||||
label: 'Chance actuelle',
|
||||
@ -53,7 +64,6 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
getTaille() { return Misc.toInt(this.system.carac.taille?.value) }
|
||||
getConstitution() { return this.getReve() }
|
||||
getForce() { return this.getReve() }
|
||||
@ -259,32 +269,70 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async openRollDialog({ name, label, template, rollData, callbackAction }) {
|
||||
async openRollDialog({ name, label, template, rollData, callbacks }) {
|
||||
const dialog = await RdDRoll.create(this, rollData,
|
||||
{ html: template, close: async html => await this._onCloseRollDialog(html) },
|
||||
{
|
||||
name: name,
|
||||
label: label,
|
||||
callbacks: [
|
||||
this.createCallbackExperience(),
|
||||
this.createCallbackAppelAuMoral(),
|
||||
{ action: callbackAction }
|
||||
]
|
||||
});
|
||||
dialog.render(true);
|
||||
{ name: name, label: label, callbacks: [this.createCallbackExperience(), this.createCallbackAppelAuMoral()].concat(callbacks) })
|
||||
dialog.render(true)
|
||||
return dialog
|
||||
}
|
||||
|
||||
createEmptyCallback() {
|
||||
return {
|
||||
condition: r => false,
|
||||
action: r => { }
|
||||
};
|
||||
}
|
||||
createCallbackExperience() { return this.createEmptyCallback(); }
|
||||
createCallbackAppelAuMoral() { return this.createEmptyCallback(); }
|
||||
createCallbackExperience() { return { action: r => { } } }
|
||||
createCallbackAppelAuMoral() { return { action: r => { } } }
|
||||
|
||||
async _onCloseRollDialog(html) { }
|
||||
|
||||
async rollCaracCompetence(caracName, compName, diff, options = { title: "" }) {
|
||||
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
||||
const competence = this.getCompetence(compName);
|
||||
await this.openRollDialog({
|
||||
name: 'jet-competence',
|
||||
label: competence ? 'Jet ' + Grammar.apostrophe('de', competence.name) : `Jet sans compétence (${compName})`,
|
||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.hbs',
|
||||
rollData: {
|
||||
alias: this.getAlias(),
|
||||
carac: this.system.carac,
|
||||
selectedCarac: this.getCaracByName(caracName),
|
||||
selectedCaracName: caracName,
|
||||
diffLibre: diff,
|
||||
competence: competence,
|
||||
show: { title: options?.title ?? '' }
|
||||
},
|
||||
callbacks: [async r => this.$onRollCompetence(r, options)]
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Méthode pour faire un jet prédéterminer sans ouvrir la fenêtre de dialogue
|
||||
* @param {*} caracName code ou label de la caractéristique. On peut utiliser 'intel' pour Intellect.
|
||||
* @param {*} compName nom de compétence ou nom abrégé.
|
||||
* @param {*} diff difficulté (0 si undefined)
|
||||
* @param {*} options
|
||||
* @returns le jet effectué
|
||||
*/
|
||||
async doRollCaracCompetence(caracName, compName, diff, options = { title: "" }) {
|
||||
const carac = this.getCaracByName(caracName);
|
||||
if (!carac) {
|
||||
ui.notifications.warn(`${this.name} n'a pas de caractéristique correspondant à ${caracName}`)
|
||||
return
|
||||
}
|
||||
const competence = this.getCompetence(compName);
|
||||
let rollData = {
|
||||
alias: this.getAlias(),
|
||||
caracValue: Number(carac.value),
|
||||
selectedCarac: carac,
|
||||
competence: competence,
|
||||
diffLibre: diff ?? 0,
|
||||
show: { title: options?.title ?? '' }
|
||||
}
|
||||
RollDataAjustements.calcul(rollData, this);
|
||||
await RdDResolutionTable.rollData(rollData);
|
||||
this.gererExperience(rollData);
|
||||
await RdDResolutionTable.displayRollData(rollData, this)
|
||||
return rollData.rolled;
|
||||
}
|
||||
|
||||
gererExperience(rollData) { }
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async roll() {
|
||||
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
||||
@ -293,61 +341,56 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
const selectedCaracName = ['apparence', 'perception', 'force', 'reve'].find(it => carac[it] != undefined)
|
||||
|
||||
await this.openRollDialog({
|
||||
name: `jet-${this.id}`,
|
||||
label: `Jet de ${this.getAlias()}`,
|
||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll.html',
|
||||
rollData: {
|
||||
alias: this.getAlias(),
|
||||
carac: carac,
|
||||
selectedCarac: carac[selectedCaracName],
|
||||
selectedCaracName: selectedCaracName,
|
||||
competences: this.itemTypes['competence']
|
||||
},
|
||||
callbackAction: r => this.$onRollCaracResult(r)
|
||||
});
|
||||
callbacks: [{ action: r => this.$onRollCaracResult(r) }]
|
||||
})
|
||||
}
|
||||
|
||||
getCarac() {
|
||||
// TODO: le niveau d'une entité de cauchemar devrait être exclu...
|
||||
return foundry.utils.mergeObject(this.system.carac,
|
||||
{
|
||||
'reve-actuel': this.getCaracReveActuel(),
|
||||
'chance-actuelle': this.getCaracChanceActuelle()
|
||||
},
|
||||
{ inplace: false })
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollCarac(caracName, jetResistance = undefined) {
|
||||
async rollCarac(caracName, options = {}) {
|
||||
if (Grammar.equalsInsensitive(caracName, 'taille')) {
|
||||
return
|
||||
}
|
||||
foundry.utils.mergeObject(options, { resistance: false, diff: 0 }, { overwrite: false })
|
||||
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
||||
let selectedCarac = this.getCaracByName(caracName)
|
||||
console.log("selectedCarac", selectedCarac)
|
||||
const title = 'Jet ' + Grammar.apostrophe('de', selectedCarac.label);
|
||||
const jetResistance = options.resistance ? caracName : undefined;
|
||||
await this.openRollDialog({
|
||||
name: 'jet-' + caracName,
|
||||
label: 'Jet ' + Grammar.apostrophe('de', selectedCarac.label),
|
||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html',
|
||||
label: title,
|
||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.hbs',
|
||||
rollData: {
|
||||
alias: this.getAlias(),
|
||||
selectedCarac: selectedCarac,
|
||||
competences: this.itemTypes['competence'],
|
||||
jetResistance: jetResistance ? caracName : undefined
|
||||
diffLibre: options.diff ?? 0,
|
||||
jetResistance: jetResistance
|
||||
},
|
||||
callbackAction: r => this.$onRollCaracResult(r)
|
||||
callbacks: [{ action: r => this.$onRollCaracResult(r) }]
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async $onRollCaracResult(rollData) {
|
||||
// Final chat message
|
||||
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-general.html');
|
||||
await RdDRollResult.displayRollData(rollData, this, 'chat-resultat-general.hbs');
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollCompetence(idOrName, options = { tryTarget: true, arme: undefined }) {
|
||||
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
||||
const competence = this.getCompetence(idOrName);
|
||||
let rollData = { carac: this.system.carac, competence: competence, arme: options.arme }
|
||||
let rollData = {
|
||||
carac: this.system.carac,
|
||||
competence: competence,
|
||||
arme: options.arme
|
||||
}
|
||||
if (competence.type == ITEM_TYPES.competencecreature) {
|
||||
const token = RdDUtility.getSelectedToken(this)
|
||||
const arme = RdDItemCompetenceCreature.armeCreature(competence)
|
||||
@ -365,18 +408,18 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
// Transformer la competence de créature
|
||||
RdDItemCompetenceCreature.setRollDataCreature(rollData)
|
||||
}
|
||||
|
||||
const dialogLabel = 'Jet ' + Grammar.apostrophe('de', competence.name);
|
||||
await this.openRollDialog({
|
||||
name: 'jet-competence',
|
||||
label: 'Jet ' + Grammar.apostrophe('de', competence.name),
|
||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html',
|
||||
label: dialogLabel,
|
||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.hbs',
|
||||
rollData: rollData,
|
||||
callbackAction: r => this.$onRollCompetence(r, options)
|
||||
callbacks: [{ action: r => this.$onRollCompetence(r, options) }]
|
||||
});
|
||||
}
|
||||
|
||||
async $onRollCompetence(rollData, options) {
|
||||
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-competence.html')
|
||||
await RdDRollResult.displayRollData(rollData, this, 'chat-resultat-competence.hbs')
|
||||
if (options?.onRollAutomate) {
|
||||
options.onRollAutomate(rollData);
|
||||
}
|
||||
@ -476,7 +519,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
await ChatUtility.createChatWithRollMode(
|
||||
{
|
||||
roll: encaissement.roll,
|
||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-resultat-encaissement.html', encaissement)
|
||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-resultat-encaissement.hbs', encaissement)
|
||||
},
|
||||
this
|
||||
)
|
||||
@ -486,7 +529,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
encaissement.isGM = true
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getGMs(),
|
||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-resultat-encaissement.html', encaissement)
|
||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-resultat-encaissement.hbs', encaissement)
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -499,7 +542,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
|| entite.isEntiteAccordee(this)) {
|
||||
return true;
|
||||
}
|
||||
const rolled = await RdDResolutionTable.roll(this.getReveActuel(), - Number(entite.system.carac.niveau.value));
|
||||
const rolled = await RdDResolutionTable.roll(this.getReveActuel(), - Number(entite.getNiveau()));
|
||||
const rollData = {
|
||||
alias: this.getAlias(),
|
||||
rolled: rolled,
|
||||
@ -511,10 +554,8 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
await entite.setEntiteReveAccordee(this);
|
||||
}
|
||||
|
||||
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-accorder-cauchemar.html');
|
||||
if (rolled.isPart) {
|
||||
await this.appliquerAjoutExperience(rollData, true);
|
||||
}
|
||||
await RdDRollResult.displayRollData(rollData, this, 'chat-resultat-accorder-cauchemar.hbs');
|
||||
await this.appliquerAjoutExperience(rollData, true);
|
||||
return rolled.isSuccess;
|
||||
}
|
||||
|
||||
|
@ -17,20 +17,20 @@ export class RdDBaseActorSangSheet extends RdDBaseActorReveSheet {
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
this.html.find('.creer-blessure-legere').click(async event => RdDItemBlessure.createBlessure(this.actor, 2));
|
||||
this.html.find('.creer-blessure-grave').click(async event => RdDItemBlessure.createBlessure(this.actor, 4));
|
||||
this.html.find('.creer-blessure-critique').click(async event => RdDItemBlessure.createBlessure(this.actor, 6));
|
||||
this.html.find('.creer-blessure-legere').click(async event => await RdDItemBlessure.createBlessure(this.actor, 2));
|
||||
this.html.find('.creer-blessure-grave').click(async event => await RdDItemBlessure.createBlessure(this.actor, 4));
|
||||
this.html.find('.creer-blessure-critique').click(async event => await RdDItemBlessure.createBlessure(this.actor, 6));
|
||||
|
||||
this.html.find('.subir-blessure-contusion').click(async event => RdDItemBlessure.applyFullBlessure(this.actor, 0));
|
||||
this.html.find('.subir-blessure-legere').click(async event => RdDItemBlessure.applyFullBlessure(this.actor, 2));
|
||||
this.html.find('.subir-blessure-grave').click(async event => RdDItemBlessure.applyFullBlessure(this.actor, 4));
|
||||
this.html.find('.subir-blessure-critique').click(async event => RdDItemBlessure.applyFullBlessure(this.actor, 6));
|
||||
this.html.find('.subir-blessure-contusion').click(async event => await RdDItemBlessure.applyFullBlessure(this.actor, 0));
|
||||
this.html.find('.subir-blessure-legere').click(async event => await RdDItemBlessure.applyFullBlessure(this.actor, 2));
|
||||
this.html.find('.subir-blessure-grave').click(async event => await RdDItemBlessure.applyFullBlessure(this.actor, 4));
|
||||
this.html.find('.subir-blessure-critique').click(async event => await RdDItemBlessure.applyFullBlessure(this.actor, 6));
|
||||
|
||||
this.html.find('.jet-vie').click(async event => this.actor.jetDeVie())
|
||||
this.html.find('.jet-vie').click(async event => await this.actor.jetDeVie())
|
||||
this.html.find('.jet-endurance').click(async event => await this.jetEndurance())
|
||||
|
||||
this.html.find('.vie-plus').click(async event => this.actor.santeIncDec("vie", 1))
|
||||
this.html.find('.vie-moins').click(async event => this.actor.santeIncDec("vie", -1))
|
||||
this.html.find('.vie-plus').click(async event => await this.actor.santeIncDec("vie", 1))
|
||||
this.html.find('.vie-moins').click(async event => await this.actor.santeIncDec("vie", -1))
|
||||
}
|
||||
|
||||
async jetEndurance() {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { RdDUtility } from "../rdd-utility.js";
|
||||
import { ReglesOptionnelles } from "../settings/regles-optionnelles.js";
|
||||
import { STATUSES } from "../settings/status-effects.js";
|
||||
import { ITEM_TYPES } from "../item.js";
|
||||
import { ITEM_TYPES } from "../constants.js";
|
||||
import { RdDBaseActorReve } from "./base-actor-reve.js";
|
||||
import { RdDDice } from "../rdd-dice.js";
|
||||
import { RdDItemBlessure } from "../item/blessure.js";
|
||||
@ -39,7 +39,12 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
|
||||
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 }
|
||||
|
||||
malusFatigue() {
|
||||
|
@ -3,19 +3,23 @@ import { Misc } from "../misc.js";
|
||||
import { DialogSplitItem } from "../dialog-split-item.js";
|
||||
import { RdDSheetUtility } from "../rdd-sheet-utility.js";
|
||||
import { Monnaie } from "../item-monnaie.js";
|
||||
import { RdDItem, ITEM_TYPES } from "../item.js";
|
||||
import { ITEM_TYPES } from "../constants.js";
|
||||
import { RdDItem } from "../item.js";
|
||||
import { RdDItemCompetenceCreature } from "../item-competencecreature.js";
|
||||
import { RdDTextEditor } from "../apps/rdd-text-roll-editor.js";
|
||||
import { ItemAction } from "../item/item-actions.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/**
|
||||
* Extend the basic ActorSheet with some very simple modifications
|
||||
* @extends {ActorSheet}
|
||||
*/
|
||||
export class RdDBaseActorSheet extends ActorSheet {
|
||||
export class RdDBaseActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
static _warnedAppV1 = true
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return foundry.utils.mergeObject(ActorSheet.defaultOptions, {
|
||||
return foundry.utils.mergeObject(foundry.appv1.sheets.ActorSheet.defaultOptions, {
|
||||
classes: ["rdd", "sheet", "actor"],
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }],
|
||||
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: undefined }],
|
||||
@ -25,7 +29,7 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
Monnaie.validerMonnaies(this.actor.itemTypes['monnaie']);
|
||||
Monnaie.validerMonnaies(this.actor)
|
||||
|
||||
this.actor.computeEtatGeneral();
|
||||
let formData = {
|
||||
@ -35,13 +39,13 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
img: this.actor.img,
|
||||
name: this.actor.name,
|
||||
system: this.actor.system,
|
||||
description: await TextEditor.enrichHTML(this.actor.system.description, { async: true }),
|
||||
notesmj: await TextEditor.enrichHTML(this.actor.system.notesmj, { async: true }),
|
||||
description: await RdDTextEditor.enrichHTML(this.actor.system.description, this.actor),
|
||||
notesmj: await RdDTextEditor.enrichHTML(this.actor.system.notesmj, this.actor),
|
||||
options: RdDSheetUtility.mergeDocumentRights(this.options, this.actor, this.isEditable),
|
||||
effects: this.actor.effects
|
||||
}
|
||||
|
||||
RdDBaseActorSheet.filterItemsPerTypeForSheet(formData, this.actor.itemTypes);
|
||||
RdDUtility.filterItemsPerTypeForSheet(formData, this.actor.itemTypes);
|
||||
formData.calc = {
|
||||
fortune: Monnaie.toSolsDeniers(this.actor.getFortune()),
|
||||
prixTotalEquipement: this.actor.computePrixTotalEquipement(),
|
||||
@ -53,6 +57,7 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs);
|
||||
formData.competences.filter(it => it.type == ITEM_TYPES.competencecreature)
|
||||
.forEach(it => it.isdommages = RdDItemCompetenceCreature.isDommages(it))
|
||||
|
||||
return formData;
|
||||
}
|
||||
|
||||
@ -76,122 +81,49 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static filterItemsPerTypeForSheet(formData, itemTypes) {
|
||||
formData.blessures = Misc.arrayOrEmpty(itemTypes['blessure']);
|
||||
formData.recettescuisine = Misc.arrayOrEmpty(itemTypes['recettecuisine']);
|
||||
formData.recettesAlchimiques = Misc.arrayOrEmpty(itemTypes['recettealchimique']);
|
||||
formData.maladies = Misc.arrayOrEmpty(itemTypes['maladie']);
|
||||
formData.poisons = Misc.arrayOrEmpty(itemTypes['poison']);
|
||||
formData.possessions = Misc.arrayOrEmpty(itemTypes['possession']);
|
||||
formData.maladiesPoisons = formData.maladies.concat(formData.poisons);
|
||||
formData.competences = (itemTypes['competence'] ?? []).concat(itemTypes['competencecreature'] ?? []);
|
||||
formData.sortsReserve = Misc.arrayOrEmpty(itemTypes['sortreserve']);
|
||||
|
||||
formData.sorts = Misc.arrayOrEmpty(itemTypes['sort']);
|
||||
formData.rencontres = Misc.arrayOrEmpty(itemTypes['rencontre']);
|
||||
formData.casestmr = Misc.arrayOrEmpty(itemTypes['casetmr']);
|
||||
formData.signesdraconiques = Misc.arrayOrEmpty(itemTypes['signedraconique']);
|
||||
formData.queues = Misc.arrayOrEmpty(itemTypes['queue']);
|
||||
formData.souffles = Misc.arrayOrEmpty(itemTypes['souffle']);
|
||||
formData.ombres = Misc.arrayOrEmpty(itemTypes['ombre']);
|
||||
formData.tetes = Misc.arrayOrEmpty(itemTypes['tete']);
|
||||
formData.taches = Misc.arrayOrEmpty(itemTypes['tache']);
|
||||
formData.meditations = Misc.arrayOrEmpty(itemTypes['meditation']);
|
||||
formData.chants = Misc.arrayOrEmpty(itemTypes['chant']);
|
||||
formData.danses = Misc.arrayOrEmpty(itemTypes['danse']);
|
||||
formData.musiques = Misc.arrayOrEmpty(itemTypes['musique']);
|
||||
formData.oeuvres = Misc.arrayOrEmpty(itemTypes['oeuvre']);
|
||||
formData.jeux = Misc.arrayOrEmpty(itemTypes['jeu']);
|
||||
|
||||
formData.services = Misc.arrayOrEmpty(itemTypes['service']);
|
||||
formData.conteneurs = Misc.arrayOrEmpty(itemTypes['conteneur']);
|
||||
formData.materiel = Misc.arrayOrEmpty(itemTypes['objet']);
|
||||
formData.armes = Misc.arrayOrEmpty(itemTypes['arme']);
|
||||
formData.armures = Misc.arrayOrEmpty(itemTypes['armure']);
|
||||
formData.munitions = Misc.arrayOrEmpty(itemTypes['munition']);
|
||||
formData.livres = Misc.arrayOrEmpty(itemTypes['livre']);
|
||||
formData.potions = Misc.arrayOrEmpty(itemTypes['potion']);
|
||||
formData.plantes = Misc.arrayOrEmpty(itemTypes['plante']);
|
||||
formData.ingredients = Misc.arrayOrEmpty(itemTypes['ingredient']);
|
||||
formData.faunes = Misc.arrayOrEmpty(itemTypes['faune']);
|
||||
formData.herbes = Misc.arrayOrEmpty(itemTypes['herbe']);
|
||||
formData.nourritureboissons = Misc.arrayOrEmpty(itemTypes['nourritureboisson']);
|
||||
formData.gemmes = Misc.arrayOrEmpty(itemTypes['gemme']);
|
||||
formData.monnaies = Misc.arrayOrEmpty(itemTypes['monnaie']).sort(Monnaie.triValeurEntiere());
|
||||
formData.objets = Misc.arrayOrEmpty(itemTypes['objet'])
|
||||
|
||||
formData.inventaires = RdDItem.getItemTypesInventaire('all')
|
||||
.map(t => Misc.arrayOrEmpty(itemTypes[t]))
|
||||
.reduce((a, b) => a.concat(b), [])
|
||||
.sort(Misc.ascending(it => it.name));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */ /** @override */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
this.html = html;
|
||||
|
||||
this.html.find('.actionItem').click(async event => await ItemAction.onActionItem(event, this.actor, this.options))
|
||||
this.html.find('.item-edit').click(async event => await this.itemActionEdit(event))
|
||||
this.html.find('.conteneur-name a').click(async event => {
|
||||
RdDUtility.toggleAfficheContenu(this.getItemId(event));
|
||||
this.render(true);
|
||||
});
|
||||
this.html.find('.actor-montrer').click(async event => this.actor.postActorToChat());
|
||||
this.html.find('.item-edit').click(async event => this.getItem(event)?.sheet.render(true))
|
||||
this.html.find('.item-montrer').click(async event => this.getItem(event)?.postItemToChat());
|
||||
RdDUtility.toggleAfficheContenu(this.getItemId(event))
|
||||
this.render(true)
|
||||
})
|
||||
|
||||
this.html.find('.actor-montrer').click(async event => await this.actor.postActorToChat());
|
||||
|
||||
this.html.find('.recherche')
|
||||
.each((index, field) => {
|
||||
this._rechercheSelectArea(field);
|
||||
})
|
||||
.keyup(async event => this._rechercherKeyup(event))
|
||||
.change(async event => this._rechercherKeyup(event));
|
||||
this.html.find('.recherche').prop("disabled", false);
|
||||
.change(async event => this._rechercherKeyup(event))
|
||||
|
||||
this.html.find('.recherche').prop("disabled", false)
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
this.html.find('.item-action').click(async event => {
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
item?.actionPrincipale(this.actor, async () => this.render())
|
||||
});
|
||||
this.html.find('.item-equip-armure').click(async event => await this.actor.equiperObjet(this.getItem(event)))
|
||||
this.html.find('.item-delete').click(async event => await RdDUtility.confirmActorItemDelete(this.getItem(event), this.actor));
|
||||
this.html.find('.item-quantite-plus').click(async event => await this.actor.itemQuantiteIncDec(this.getItemId(event), 1));
|
||||
this.html.find('.item-quantite-moins').click(async event => await this.actor.itemQuantiteIncDec(this.getItemId(event), -1));
|
||||
|
||||
|
||||
this.html.find('.item-split').click(async event => {
|
||||
const item = this.getItem(event);
|
||||
RdDSheetUtility.splitItem(item, this.actor);
|
||||
});
|
||||
this.html.find('.item-quantite-plus').click(async event => this.actor.itemQuantiteIncDec(this.getItemId(event), 1));
|
||||
this.html.find('.item-quantite-moins').click(async event => this.actor.itemQuantiteIncDec(this.getItemId(event), -1));
|
||||
this.html.find('.item-delete').click(async event => RdDUtility.confirmActorItemDelete(this, this.getItem(event)));
|
||||
this.html.find('.item-vendre').click(async event => this.vendre(this.getItem(event)));
|
||||
|
||||
this.html.find('.creer-un-objet').click(async event => {
|
||||
this.selectObjetTypeToCreate();
|
||||
});
|
||||
this.html.find('.nettoyer-conteneurs').click(async event => {
|
||||
this.actor.nettoyerConteneurs();
|
||||
});
|
||||
this.html.find('.creer-un-objet').click(async event => await this.selectObjetTypeToCreate())
|
||||
this.html.find('.nettoyer-conteneurs').click(async event => await this.actor.nettoyerConteneurs())
|
||||
|
||||
this.html.find('.vue-detaillee').click(async event => {
|
||||
this.options.vueDetaillee = !this.options.vueDetaillee;
|
||||
this.render(true);
|
||||
this.options.vueDetaillee = !this.options.vueDetaillee
|
||||
this.render(true)
|
||||
});
|
||||
}
|
||||
|
||||
if (this.options.vueDetaillee) {
|
||||
// On carac change
|
||||
this.html.find('.carac-value').change(async event => {
|
||||
let caracName = event.currentTarget.name.replace(".value", "").replace("system.carac.", "");
|
||||
this.actor.updateCarac(caracName, parseInt(event.target.value));
|
||||
});
|
||||
// On competence change
|
||||
this.html.find('.competence-value').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
//console.log("Competence changed :", compName);
|
||||
this.actor.updateCompetence(compName, parseInt(event.target.value));
|
||||
});
|
||||
}
|
||||
|
||||
itemActionEdit(event) {
|
||||
const item = this.getItem(event);
|
||||
return item?.sheet.render(true);
|
||||
}
|
||||
|
||||
_rechercherKeyup(event) {
|
||||
@ -260,7 +192,7 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
/* -------------------------------------------- */
|
||||
async selectObjetTypeToCreate() {
|
||||
let types = this.getTypesInventaire().sort(Misc.ascending(type => Misc.typeName('Item', type)));
|
||||
let content = `<span class="competence-label">Selectionnez le type d'équipement</span><select class="item-type">`;
|
||||
let content = `<span class="generic-label">Selectionnez le type d'équipement</span><select class="item-type">`;
|
||||
for (let typeName of types) {
|
||||
content += `<option value="${typeName}">${Misc.typeName('Item', typeName)}</option>`
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ import { ChatUtility } from "../chat-utility.js";
|
||||
import { SYSTEM_SOCKET_ID } from "../constants.js";
|
||||
import { Grammar } from "../grammar.js";
|
||||
import { Monnaie } from "../item-monnaie.js";
|
||||
import { ITEM_TYPES } from "../item.js";
|
||||
import { ITEM_TYPES } from "../constants.js";
|
||||
import { Misc } from "../misc.js";
|
||||
import { RdDAudio } from "../rdd-audio.js";
|
||||
import { RdDConfirm } from "../rdd-confirm.js";
|
||||
@ -21,7 +21,7 @@ export class RdDBaseActor extends Actor {
|
||||
|
||||
static $findCaracByName(carac, name) {
|
||||
const caracList = Object.entries(carac);
|
||||
let entry = Misc.findFirstLike(name, caracList, { mapper: it => it[0], description: 'caractéristique' });
|
||||
let entry = Misc.findFirstLike(name, caracList, { mapper: it => it[0], description: 'caractéristique', onMessage: m => { } });
|
||||
if (!entry || entry.length == 0) {
|
||||
entry = Misc.findFirstLike(name, caracList, { mapper: it => it[1].label, description: 'caractéristique' });
|
||||
}
|
||||
@ -81,7 +81,6 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static getRealActor(actorId, tokenId) {
|
||||
if (tokenId) {
|
||||
let token = canvas.tokens.get(tokenId)
|
||||
@ -161,8 +160,11 @@ export class RdDBaseActor extends Actor {
|
||||
return RdDBaseActor.$findCaracByName(carac, name);
|
||||
}
|
||||
|
||||
mapCarac(caracCode) { return caracCode }
|
||||
|
||||
getCaracByName(name) {
|
||||
switch (Grammar.toLowerCaseNoAccent(name)) {
|
||||
name = this.mapCarac(Grammar.toLowerCaseNoAccent(name))
|
||||
switch (name) {
|
||||
case 'reve-actuel': case 'reve actuel':
|
||||
return this.getCaracReveActuel();
|
||||
case 'chance-actuelle': case 'chance-actuelle':
|
||||
@ -176,11 +178,19 @@ export class RdDBaseActor extends Actor {
|
||||
await super._preCreate(data, options, user);
|
||||
|
||||
// Configure prototype token settings
|
||||
const prototypeToken = {};
|
||||
if (this.type === "personnage") Object.assign(prototypeToken, {
|
||||
sight: { enabled: true }, actorLink: true, disposition: CONST.TOKEN_DISPOSITIONS.FRIENDLY
|
||||
});
|
||||
this.updateSource({ prototypeToken });
|
||||
if (this.type === "personnage") {
|
||||
this.updateSource({
|
||||
sight: { enabled: true },
|
||||
actorLink: options.fromCompendium ? data.prototypeToken.actorLink : true,
|
||||
disposition: CONST.TOKEN_DISPOSITIONS.FRIENDLY
|
||||
})
|
||||
} else {
|
||||
const prototypeToken = {
|
||||
sight: { enabled: true },
|
||||
disposition: CONST.TOKEN_DISPOSITIONS.NEUTRAL
|
||||
}
|
||||
this.updateSource({ prototypeToken });
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -234,16 +244,19 @@ export class RdDBaseActor extends Actor {
|
||||
async onUpdateActor(update, options, actorId) { }
|
||||
async onDeleteItem(item, options, id) {
|
||||
if (item.isInventaire()) {
|
||||
this._removeItemFromConteneur(item)
|
||||
await this._removeItemFromConteneur(item)
|
||||
}
|
||||
}
|
||||
|
||||
_removeItemFromConteneur(item) {
|
||||
this.items.filter(it => it.isConteneur() && it.system.contenu.includes(item.id))
|
||||
.forEach(conteneur => {
|
||||
const nouveauContenu = conteneur.system.contenu.filter(id => id != item.id);
|
||||
conteneur.update({ 'system.contenu': nouveauContenu });
|
||||
});
|
||||
async _removeItemFromConteneur(item) {
|
||||
const updates = this.items.filter(it => it.isConteneur() && it.system.contenu.includes(item.id))
|
||||
.map(conteneur => {
|
||||
const nouveauContenu = conteneur.system.contenu.filter(id => id != item.id)
|
||||
return { _id: conteneur.id, 'system.contenu': nouveauContenu }
|
||||
})
|
||||
if (updates.length > 0) {
|
||||
await this.updateEmbeddedDocuments('Item', updates)
|
||||
}
|
||||
}
|
||||
|
||||
async onTimeChanging(oldTimestamp, newTimestamp) {
|
||||
@ -404,7 +417,7 @@ export class RdDBaseActor extends Actor {
|
||||
user: achat.userId,
|
||||
speaker: { alias: (acheteur ?? vendeur).getAlias() },
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-achat-item.html', chatAchatItem)
|
||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-achat-item.hbs', chatAchatItem)
|
||||
});
|
||||
|
||||
if (!achat.vente.quantiteIllimite) {
|
||||
@ -721,31 +734,26 @@ export class RdDBaseActor extends Actor {
|
||||
name: this.getAlias(),
|
||||
system: { description: this.system.description }
|
||||
}
|
||||
renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.html', chatData)
|
||||
foundry.applications.handlebars.renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.hbs', chatData)
|
||||
.then(html => ChatMessage.create(RdDUtility.chatDataSetup(html, modeOverride)));
|
||||
}
|
||||
|
||||
actionImpossible(action) {
|
||||
ui.notifications.info(`${this.getAlias()} ne peut pas faire cette action: ${action}`)
|
||||
|
||||
}
|
||||
|
||||
async jetEthylisme() { this.actionImpossible("jet d'éthylisme") }
|
||||
async rollAppelChance() { this.actionImpossible("appel à la chance") }
|
||||
async jetDeMoral() { this.actionImpossible("jet de moral") }
|
||||
|
||||
async actionPrincipale(item, onActionItem = async () => { }) {
|
||||
switch (item.type) {
|
||||
case ITEM_TYPES.conteneur: return await item.sheet.render(true);
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
async resetItemUse() { }
|
||||
async incDecItemUse(itemId, inc = 1) { }
|
||||
async incDecItemUse(itemId, shouldIncrease = true) { }
|
||||
getItemUse(itemId) { return 0; }
|
||||
|
||||
async finDeRound(options = { terminer: false }) { }
|
||||
isActorCombat() { return false }
|
||||
getCaracInit(competence) { return 0 }
|
||||
|
||||
listActionsCombat() { return [] }
|
||||
listActionsPossessions() {
|
||||
return this.itemTypes[ITEM_TYPES.possession]
|
||||
|
@ -1,6 +1,4 @@
|
||||
import { DialogItemAchat } from "../achat-vente/dialog-item-achat.js";
|
||||
import { RdDItem } from "../item.js";
|
||||
import { RdDUtility } from "../rdd-utility.js";
|
||||
import { RdDBaseActorSheet } from "./base-actor-sheet.js";
|
||||
|
||||
/**
|
||||
@ -12,7 +10,7 @@ export class RdDCommerceSheet extends RdDBaseActorSheet {
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor/commerce-actor-sheet.html",
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor/commerce-actor-sheet.hbs",
|
||||
width: 600, height: 720,
|
||||
tabs: []
|
||||
}, { inplace: false })
|
||||
@ -44,12 +42,8 @@ export class RdDCommerceSheet extends RdDBaseActorSheet {
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
this.html.find('a.item-acheter').click(async event => await this.vente(this.getItem(event)));
|
||||
|
||||
if (!this.options.editable) return;
|
||||
|
||||
this.html.find('a.item-quantite-moins').click(async event => await this.getItem(event)?.quantiteIncDec(-1, { supprimerSiZero: false }));
|
||||
this.html.find('a.item-quantite-plus').click(async event => await this.getItem(event)?.quantiteIncDec(1));
|
||||
this.html.find('input.item-quantite').change(async event => {
|
||||
const newQuantite = Math.max(0, Number.parseInt(this.html.find(event.currentTarget).val()));
|
||||
await this.getItem(event)?.update({ "system.quantite": newQuantite });
|
||||
@ -63,28 +57,4 @@ export class RdDCommerceSheet extends RdDBaseActorSheet {
|
||||
getTypesInventaire() {
|
||||
return RdDItem.getItemTypesInventaire('all');
|
||||
}
|
||||
|
||||
|
||||
async vente(item) {
|
||||
const acheteur = RdDUtility.getSelectedActor();
|
||||
if (!acheteur) {
|
||||
ui.notifications.warn(`Pas d'acheteur sélectionné`);
|
||||
return;
|
||||
}
|
||||
const disponible = this.actor.getQuantiteDisponible(item)
|
||||
if (disponible == 0) {
|
||||
ui.notifications.warn(`${this.getAlias()} n'a plus de ${item.name} en vente`);
|
||||
return;
|
||||
}
|
||||
|
||||
await DialogItemAchat.onAcheter({
|
||||
item,
|
||||
vendeur: this.actor,
|
||||
acheteur,
|
||||
quantiteIllimite: disponible == undefined,
|
||||
nbLots: disponible ?? 1,
|
||||
tailleLot: 1,
|
||||
prixLot: item.calculerPrixCommercant()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { DialogItemAchat } from "../achat-vente/dialog-item-achat.js";
|
||||
import { Misc } from "../misc.js";
|
||||
import { RdDUtility } from "../rdd-utility.js";
|
||||
import { RdDBaseActor } from "./base-actor.js";
|
||||
|
||||
export class RdDCommerce extends RdDBaseActor {
|
||||
@ -37,4 +39,27 @@ export class RdDCommerce extends RdDBaseActor {
|
||||
const pourcentage = this.system.pourcentage ?? 100;
|
||||
return Misc.keepDecimals(Math.ceil(item.system.cout * pourcentage) / 100, 2);
|
||||
}
|
||||
async vente(item) {
|
||||
const acheteur = RdDUtility.getSelectedActor();
|
||||
if (!acheteur) {
|
||||
ui.notifications.warn(`Pas d'acheteur sélectionné`);
|
||||
return;
|
||||
}
|
||||
const disponible = this.getQuantiteDisponible(item)
|
||||
if (disponible == 0) {
|
||||
ui.notifications.warn(`${this.getAlias()} n'a plus de ${item.name} en vente`);
|
||||
return;
|
||||
}
|
||||
|
||||
await DialogItemAchat.onAcheter({
|
||||
item,
|
||||
vendeur: this,
|
||||
acheteur,
|
||||
quantiteIllimite: disponible == undefined,
|
||||
nbLots: disponible ?? 1,
|
||||
tailleLot: 1,
|
||||
prixLot: item.calculerPrixCommercant()
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -10,7 +10,7 @@ export class RdDCreatureSheet extends RdDBaseActorSangSheet {
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return foundry.utils.mergeObject(RdDBaseActorSangSheet.defaultOptions, {
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-creature-sheet.html",
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-creature-sheet.hbs",
|
||||
width: 640, height: 720
|
||||
}, { inplace: false })
|
||||
}
|
||||
@ -26,15 +26,15 @@ export class RdDCreatureSheet extends RdDBaseActorSangSheet {
|
||||
// On competence change
|
||||
this.html.find('.creature-carac').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
this.actor.updateCreatureCompetence(compName, "carac_value", parseInt(event.target.value));
|
||||
await this.actor.updateCreatureCompetence(compName, "carac_value", parseInt(event.target.value));
|
||||
});
|
||||
this.html.find('.creature-niveau').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
this.actor.updateCreatureCompetence(compName, "niveau", parseInt(event.target.value));
|
||||
await this.actor.updateCreatureCompetence(compName, "niveau", parseInt(event.target.value));
|
||||
});
|
||||
this.html.find('.creature-dommages').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
this.actor.updateCreatureCompetence(compName, "dommages", parseInt(event.target.value));
|
||||
await this.actor.updateCreatureCompetence(compName, "dommages", parseInt(event.target.value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { ITEM_TYPES } from "../item.js";
|
||||
import { Grammar } from "../grammar.js";
|
||||
import { ITEM_TYPES } from "../constants.js";
|
||||
import { LIST_CARAC_AUTRES } from "../rdd-carac.js";
|
||||
import { RdDBaseActorSang } from "./base-actor-sang.js";
|
||||
|
||||
export class RdDCreature extends RdDBaseActorSang {
|
||||
@ -32,4 +34,16 @@ export class RdDCreature extends RdDBaseActorSang {
|
||||
}
|
||||
}
|
||||
|
||||
mapCarac(caracCode) {
|
||||
switch (caracCode) {
|
||||
case 'vue': case 'ouie': case 'odoratgout': case 'empathie': case 'perception':
|
||||
return 'perception'
|
||||
case 'agilite':
|
||||
return 'force'
|
||||
case 'force': case 'constitution': case 'taille': case 'reve': case 'volonte':
|
||||
return caracCode
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,19 +1,22 @@
|
||||
import { RdDBaseActorReveSheet } from "./base-actor-reve-sheet.js";
|
||||
import { RdDSheetUtility } from "../rdd-sheet-utility.js";
|
||||
import { RdDUtility } from "../rdd-utility.js";
|
||||
import { DialogSelect } from "../dialog-select.js";
|
||||
|
||||
export class RdDActorEntiteSheet extends RdDBaseActorReveSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return foundry.utils.mergeObject(RdDBaseActorReveSheet.defaultOptions, {
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-entite-sheet.html",
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-entite-sheet.hbs",
|
||||
width: 640, height: 720,
|
||||
}, { inplace: false })
|
||||
}
|
||||
|
||||
async getData() {
|
||||
let formData = await super.getData();
|
||||
formData.niveau = this.actor.getNiveau()
|
||||
delete formData.system.carac.niveau
|
||||
formData.resonances = this.actor.system.sante.resonnance.actors.map(actorId => game.actors.get(actorId))
|
||||
.map(actor => { return { id: actor.id, name: actor.name, img: actor.img } })
|
||||
return formData
|
||||
@ -30,28 +33,32 @@ export class RdDActorEntiteSheet extends RdDBaseActorReveSheet {
|
||||
// On competence change
|
||||
this.html.find('.creature-carac').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
this.actor.updateCreatureCompetence(compName, "carac_value", parseInt(event.target.value));
|
||||
});
|
||||
this.html.find('.creature-niveau').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
this.actor.updateCreatureCompetence(compName, "niveau", parseInt(event.target.value));
|
||||
await this.actor.updateCreatureCompetence(compName, "carac_value", parseInt(event.target.value));
|
||||
});
|
||||
this.html.find('.creature-dommages').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
this.actor.updateCreatureCompetence(compName, "dommages", parseInt(event.target.value));
|
||||
});
|
||||
await this.actor.updateCreatureCompetence(compName, "dommages", parseInt(event.target.value));
|
||||
})
|
||||
|
||||
this.html.find('.resonance-add').click(async event =>
|
||||
await DialogSelect.select({
|
||||
label: "Choisir un acteur à accorder",
|
||||
list: game.actors.filter(it => it.isPersonnage() && it.prototypeToken.actorLink)
|
||||
},
|
||||
it => this.resonanceAdd(it.id))
|
||||
)
|
||||
|
||||
this.html.find('.resonance-delete').click(async event => {
|
||||
const li = RdDSheetUtility.getEventElement(event);
|
||||
const actorId = li.data("actor-id");
|
||||
if (actorId) {
|
||||
const actorResonance = game.actors.get(actorId);
|
||||
RdDUtility.confirmSubActeurDelete(this, actorResonance, li, () => {
|
||||
console.log('Delete : ', actorId);
|
||||
this.deleteSubActeur(actorId);
|
||||
this.resonanceDelete(actorId);
|
||||
RdDUtility.slideOnDelete(this, li);
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
async _onDropActor(event, dragData) {
|
||||
@ -60,7 +67,13 @@ export class RdDActorEntiteSheet extends RdDBaseActorReveSheet {
|
||||
super._onDropActor(event, dragData)
|
||||
}
|
||||
|
||||
async deleteSubActeur(actorId) {
|
||||
async resonanceAdd(actorId) {
|
||||
let newResonances = [...this.actor.system.sante.resonnance.actors, actorId]
|
||||
await this.actor.update({ 'system.sante.resonnance.actors': newResonances });
|
||||
}
|
||||
|
||||
async resonanceDelete(actorId) {
|
||||
console.log('Delete : ', actorId);
|
||||
let newResonances = this.actor.system.sante.resonnance.actors.filter(id => id != actorId);
|
||||
await this.actor.update({ 'system.sante.resonnance.actors': newResonances }, { renderSheet: false });
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { ENTITE_INCARNE, ENTITE_NONINCARNE } from "../constants.js";
|
||||
import { ITEM_TYPES } from "../item.js";
|
||||
import { ITEM_TYPES } from "../constants.js";
|
||||
import { Misc } from "../misc.js";
|
||||
import { RdDCarac } from "../rdd-carac.js";
|
||||
import { RdDEncaisser } from "../rdd-roll-encaisser.js";
|
||||
import { STATUSES } from "../settings/status-effects.js";
|
||||
import { RdDBaseActorReve } from "./base-actor-reve.js";
|
||||
@ -18,12 +19,23 @@ export class RdDEntite extends RdDBaseActorReve {
|
||||
isEntite(typeentite = []) {
|
||||
return (typeentite.length == 0 || typeentite.includes(this.system.definition.typeentite));
|
||||
}
|
||||
|
||||
isNonIncarnee() { return this.isEntite([ENTITE_NONINCARNE]) }
|
||||
|
||||
getReveActuel() {
|
||||
return Misc.toInt(this.system.carac.reve?.value)
|
||||
}
|
||||
|
||||
getCarac() {
|
||||
const carac = super.getCarac()
|
||||
delete carac.niveau
|
||||
return carac
|
||||
}
|
||||
|
||||
getNiveau() {
|
||||
const reve = this.getReve()
|
||||
return RdDCarac.getCaracDerivee(reve).niveau
|
||||
}
|
||||
getForce() { return this.getReve() }
|
||||
getAgilite() { return this.getReve() }
|
||||
getChance() { return this.getReve() }
|
||||
@ -64,6 +76,7 @@ export class RdDEntite extends RdDBaseActorReve {
|
||||
}
|
||||
return {}
|
||||
}
|
||||
|
||||
async encaisser() {
|
||||
if (this.isNonIncarnee()) {
|
||||
return
|
||||
@ -104,4 +117,14 @@ export class RdDEntite extends RdDBaseActorReve {
|
||||
super.setEntiteReveAccordee(actor)
|
||||
}
|
||||
}
|
||||
|
||||
mapCarac(caracCode) {
|
||||
switch (caracCode) {
|
||||
case 'taille':
|
||||
case 'reve':
|
||||
return caracCode
|
||||
}
|
||||
return 'reve'
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,8 +6,8 @@ import { ExportScriptarium } from "./export-scriptarium.js";
|
||||
import { CATEGORIES_COMPETENCES, CATEGORIES_DRACONIC, Mapping } from "./mapping.js";
|
||||
|
||||
export class RdDActorExportSheet extends RdDActorSheet {
|
||||
static async init() {
|
||||
await loadTemplates([
|
||||
static init() {
|
||||
foundry.applications.handlebars.loadTemplates([
|
||||
"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/blessures.hbs",
|
||||
@ -21,8 +21,9 @@ 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/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() {
|
||||
return foundry.utils.mergeObject(RdDActorSheet.defaultOptions, {
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/actor-encart-sheet.hbs",
|
||||
@ -103,13 +104,12 @@ export class RdDActorExportSheet extends RdDActorSheet {
|
||||
this.html.find('.click-blessure-add').click(async event =>
|
||||
await this.actor.ajouterBlessure({
|
||||
gravite: this.html.find(event.currentTarget).data('gravite')
|
||||
// event.currentTarget.attributes['data-gravite'].value
|
||||
})
|
||||
)
|
||||
this.html.find('.button-export').click(async event => {
|
||||
this.html.find('.button-export').click(async event => await
|
||||
ExportScriptarium.INSTANCE.exportActors([this.actor],
|
||||
`${this.actor.uuid}-${this.actor.name}`
|
||||
)
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { ACTOR_TYPES } from "../../item.js"
|
||||
import { ACTOR_TYPES } from "../../constants.js"
|
||||
import { Misc } from "../../misc.js"
|
||||
import { EXPORT_CSV_SCRIPTARIUM, OptionsAvancees } from "../../settings/options-avancees.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 {
|
||||
|
||||
|
@ -2,7 +2,7 @@ import { Grammar } from "../../grammar.js"
|
||||
import { RdDItemArme } from "../../item-arme.js"
|
||||
import { RdDItemCompetence } from "../../item-competence.js"
|
||||
import { RdDItemSort } from "../../item-sort.js"
|
||||
import { ITEM_TYPES } from "../../item.js"
|
||||
import { ITEM_TYPES } from "../../constants.js"
|
||||
import { Misc } from "../../misc.js"
|
||||
import { RdDTimestamp } from "../../time/rdd-timestamp.js"
|
||||
import { RdDBonus } from "../../rdd-bonus.js"
|
||||
@ -83,6 +83,7 @@ const MAPPING_BASE = [
|
||||
{ column: "protectionarmure", colName: 'Protection', getter: (actor, context) => Mapping.getProtectionArmure(actor, context) },
|
||||
{ column: "malus_armure", getter: (actor, context) => Mapping.getMalusArmure(actor, context) },
|
||||
{ column: "reve_actuel", rollClass: 'roll-reve-actuel', colName: 'Rêve actuel', getter: (actor, context) => actor.system.reve.reve.value },
|
||||
{ column: "chance_actuel", rollClass: 'roll-chance-actuelle', colName: 'Chance actuelle', getter: (actor, context) => actor.system.compteurs.chance.value },
|
||||
{ column: "vie_actuel", rollClass: 'jet-vie', getter: (actor, context) => actor.system.sante.vie.value },
|
||||
{ column: "endurance_actuel", rollClass: 'jet-endurance', getter: (actor, context) => actor.system.sante.endurance.value },
|
||||
{ column: "esquive", getter: (actor, context) => Mapping.getEsquive(context) },
|
||||
@ -278,7 +279,7 @@ export class Mapping {
|
||||
const race = ['', 'humain'].includes(Grammar.toLowerCaseNoAccent(actor.system.race)) ? '' : (actor.system.race + ' ')
|
||||
const heure = actor.system.heure
|
||||
const hn = `${sexeFeminin} à l'heure ${RdDTimestamp.definition(heure).avecArticle}`
|
||||
const age = actor.system.age ? `${actor.system.age} ans` : undefined
|
||||
const age = (actor.system.age && actor.system.age >0) ? `${actor.system.age} ans` : undefined
|
||||
const taille = actor.system.taille
|
||||
const poids = actor.system.poids
|
||||
const cheveux = actor.system.cheveux ? `cheveux ${actor.system.cheveux}` : undefined
|
||||
|
@ -26,7 +26,7 @@ const RANDOM_VALUES = {
|
||||
|
||||
export class AppPersonnageAleatoire extends FormApplication {
|
||||
static preloadHandlebars() {
|
||||
loadTemplates([
|
||||
foundry.applications.handlebars.loadTemplates([
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs',
|
||||
])
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ export class RdDActorVehiculeSheet extends RdDBaseActorSheet {
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return foundry.utils.mergeObject(RdDBaseActorSheet.defaultOptions, {
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.html",
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.hbs",
|
||||
width: 640, height: 720,
|
||||
}, { inplace: false })
|
||||
}
|
||||
@ -32,18 +32,10 @@ export class RdDActorVehiculeSheet extends RdDBaseActorSheet {
|
||||
super.activateListeners(html);
|
||||
if (!this.options.editable) return;
|
||||
|
||||
this.html.find('.resistance-moins').click(async event => {
|
||||
this.actor.vehicleIncDec("resistance", -1);
|
||||
});
|
||||
this.html.find('.resistance-plus').click(async event => {
|
||||
this.actor.vehicleIncDec("resistance", 1);
|
||||
});
|
||||
this.html.find('.structure-moins').click(async event => {
|
||||
this.actor.vehicleIncDec("structure", -1);
|
||||
});
|
||||
this.html.find('.structure-plus').click(async event => {
|
||||
this.actor.vehicleIncDec("structure", 1);
|
||||
});
|
||||
this.html.find('.resistance-moins').click(async event => await this.actor.vehicleIncDec("resistance", -1))
|
||||
this.html.find('.resistance-plus').click(async event => await this.actor.vehicleIncDec("resistance", 1))
|
||||
this.html.find('.structure-moins').click(async event => await this.actor.vehicleIncDec("structure", -1))
|
||||
this.html.find('.structure-plus').click(async event => await this.actor.vehicleIncDec("structure", 1))
|
||||
}
|
||||
|
||||
}
|
||||
|
5
module/applications/sheets/_module.mjs
Normal file
@ -0,0 +1,5 @@
|
||||
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"
|
||||
|
111
module/applications/sheets/common-item-sheet.mjs
Normal file
@ -0,0 +1,111 @@
|
||||
const { HandlebarsApplicationMixin } = foundry.applications.api
|
||||
import { SYSTEM_RDD } from "../../constants.js"
|
||||
import { Misc } from "../../misc.js"
|
||||
import { RdDSheetUtility } from "../../rdd-sheet-utility.js";
|
||||
|
||||
|
||||
export default class RdDItemBaseSheet extends HandlebarsApplicationMixin(foundry.applications.sheets.ItemSheetV2) {
|
||||
|
||||
static preloadHandlebars(...templatesList) {
|
||||
const handlebars = ["systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/header.hbs"]
|
||||
templatesList.forEach(templates =>
|
||||
templates.forEach(t =>
|
||||
t.handlebars().forEach(h => handlebars.push(h))
|
||||
)
|
||||
)
|
||||
loadTemplates(Misc.distinct(handlebars))
|
||||
}
|
||||
|
||||
static register(sheetClass) {
|
||||
const itemType = sheetClass.ITEM_TYPE
|
||||
Items.registerSheet(SYSTEM_RDD, sheetClass, {
|
||||
label: Misc.typeName('Item', itemType),
|
||||
types: [itemType],
|
||||
makeDefault: true
|
||||
})
|
||||
}
|
||||
|
||||
static registerAll(...sheetClasses) {
|
||||
const handlebars = ["systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/header.hbs"]
|
||||
sheetClasses.forEach(sheetClass => {
|
||||
sheetClass.TEMPLATES.forEach(t =>
|
||||
t.handlebars().forEach(h => handlebars.push(h))
|
||||
)
|
||||
const itemType = sheetClass.ITEM_TYPE
|
||||
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
|
||||
}
|
35
module/applications/sheets/monnaie-sheet.mjs
Normal file
@ -0,0 +1,35 @@
|
||||
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs";
|
||||
import { ITEM_TYPES } from "../../constants.js";
|
||||
import RdDItemBaseSheet from "./common-item-sheet.mjs";
|
||||
|
||||
export default class RdDMonnaieSheet extends RdDItemBaseSheet {
|
||||
|
||||
/** @override */
|
||||
static get ITEM_TYPE() { return ITEM_TYPES.monnaie }
|
||||
static get TEMPLATES() { return [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE] }
|
||||
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = Object.assign({},
|
||||
RdDItemBaseSheet.DEFAULT_OPTIONS,
|
||||
{
|
||||
classes: ["fvtt-rdd", "item", "monnaie"],
|
||||
position: { width: 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)
|
||||
)
|
||||
}
|
||||
}
|
34
module/applications/sheets/munition-sheet.mjs
Normal file
@ -0,0 +1,34 @@
|
||||
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs";
|
||||
import { ITEM_TYPES } from "../../constants.js";
|
||||
import RdDItemBaseSheet from "./common-item-sheet.mjs";
|
||||
|
||||
export default class RdDMunitionSheet extends RdDItemBaseSheet {
|
||||
/** @override */
|
||||
static get ITEM_TYPE() { return ITEM_TYPES.munition }
|
||||
static get TEMPLATES() { return [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE] }
|
||||
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = Object.assign({},
|
||||
RdDItemBaseSheet.DEFAULT_OPTIONS,
|
||||
{
|
||||
classes: ["fvtt-rdd", "item", "munition"],
|
||||
position: { width: 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)
|
||||
)
|
||||
}
|
||||
}
|
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: 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)
|
||||
)
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@ import { Grammar } from "../grammar.js";
|
||||
import { Misc } from "../misc.js";
|
||||
import { ENTITE_INCARNE, ENTITE_NONINCARNE } from "../constants.js";
|
||||
import { RdDItemTete } from "../item/tete.js";
|
||||
import { ITEM_TYPES } from "../constants.js";
|
||||
|
||||
const WHITESPACES = "\\s+"
|
||||
const NUMERIC = "[\\+\\-]?\\d+"
|
||||
@ -26,14 +27,13 @@ const MANIEMENTS = {
|
||||
'de lancer': (weapon) => { return { name: weapon.system.lancer, categorie: 'lancer' } },
|
||||
'de jet': (weapon) => { return { name: weapon.system.lancer, categorie: 'lancer' } },
|
||||
'à une main': (weapon) => { return { name: weapon.system.competence, categorie: 'melee' } },
|
||||
'à deux main': (weapon) => { return { name: weapon.system.competence.replace("à 1 main", "à 2 main"), categorie: 'melee' } },
|
||||
'à deux mains': (weapon) => { return { name: weapon.system.competence.replace("à 1 main", "à 2 mains"), categorie: 'melee' } },
|
||||
'mêlée': (weapon) => { return { name: weapon.system.competence, categorie: 'melee' } },
|
||||
}
|
||||
const XREGEXP_WEAPON_MANIEMENT = "(?<maniement>(" + Misc.join(Object.keys(MANIEMENTS), '|') + "))"
|
||||
|
||||
const XREGEXP_SORT_VOIE = "(?<voies>[OHNT](\\/[OHNT])*)"
|
||||
const XREGEXP_SORT_NAME = "(?<name>[^\\(]+)"
|
||||
// const XREGEXP_SORT_CASE = "(?<coord>([A-Za-zÀ-ÖØ-öø-ÿ\\s\\-]+|[A-M]\\d{1,2})+)"
|
||||
const XREGEXP_SORT_CASE = "(?<coord>([A-Za-zÀ-ÖØ-öø-ÿ\\s\\-]+|[A-M]\\d{1,2}))"
|
||||
|
||||
const XREGEXP_SORT = "(" + XREGEXP_SORT_VOIE
|
||||
@ -164,26 +164,18 @@ export class RdDStatBlockParser {
|
||||
switch (type) {
|
||||
case "creature":
|
||||
RdDStatBlockParser.parseCreature(statString, actorData)
|
||||
await RdDStatBlockParser.parseCompetences(statString, actorData, items)
|
||||
break
|
||||
case "entite":
|
||||
RdDStatBlockParser.parseEntite(statString, actorData)
|
||||
await RdDStatBlockParser.parseCompetences(statString, actorData, items)
|
||||
break
|
||||
}
|
||||
if (type == "personnage") {
|
||||
// Now process armors
|
||||
await RdDStatBlockParser.parseArmors(statString, actorData, items);
|
||||
}
|
||||
|
||||
// Get skills from compendium
|
||||
await RdDStatBlockParser.parseCompetences(statString, actorData, items);
|
||||
|
||||
|
||||
if (type == "personnage") {
|
||||
// Now process weapons
|
||||
await RdDStatBlockParser.parseWeapons(statString, items);
|
||||
|
||||
await RdDStatBlockParser.parseHautReve(statString, actorData, items);
|
||||
RdDStatBlockParser.parsePersonnage(statString, actorData);
|
||||
case "personnage":
|
||||
await RdDStatBlockParser.parseArmors(statString, actorData, items);
|
||||
await RdDStatBlockParser.parseCompetences(statString, actorData, items);
|
||||
await RdDStatBlockParser.parseWeapons(statString, items);
|
||||
await RdDStatBlockParser.parseHautReve(statString, actorData, items);
|
||||
RdDStatBlockParser.parsePersonnage(statString, actorData);
|
||||
}
|
||||
|
||||
const name = RdDStatBlockParser.extractName(type, statString);
|
||||
@ -193,6 +185,7 @@ export class RdDStatBlockParser {
|
||||
|
||||
let newActor = await RdDBaseActorReve.create({ name, type, system: actorData, items });
|
||||
await newActor.remiseANeuf()
|
||||
await RdDStatBlockParser.adjustAttacks(newActor)
|
||||
await RdDStatBlockParser.setValeursActuelles(newActor, statString)
|
||||
await newActor?.sheet.render(true)
|
||||
}
|
||||
@ -267,7 +260,7 @@ export class RdDStatBlockParser {
|
||||
}
|
||||
let weapMatch = XRegExp.exec(statString, XRegExp(weapon.name
|
||||
+ "(\\s*" + XREGEXP_WEAPON_MANIEMENT + ")?"
|
||||
+ "\\s+(?<value>\\+\\d+)", 'giu'));
|
||||
+ "\\s+(?<value>[\\+\\-]?\\d+)", 'giu'));
|
||||
if (weapMatch) {
|
||||
weapon = weapon.toObject();
|
||||
weapon.system.equipe = 'true';
|
||||
@ -296,6 +289,21 @@ export class RdDStatBlockParser {
|
||||
}
|
||||
}
|
||||
|
||||
static async adjustAttacks(newActor) {
|
||||
if (["creature", "entite"].includes(newActor.type)) {
|
||||
const bonusDommages = newActor.getBonusDegat()
|
||||
const ajustementAttaques = newActor.itemTypes[ITEM_TYPES.competencecreature].filter(it => it.system.iscombat)
|
||||
.map(it => {
|
||||
return {
|
||||
_id: it.id,
|
||||
'system.categorie': 'melee',
|
||||
'system.dommages': it.system.dommages - bonusDommages
|
||||
}
|
||||
})
|
||||
await newActor.updateEmbeddedDocuments('Item', ajustementAttaques)
|
||||
}
|
||||
}
|
||||
|
||||
static async setValeursActuelles(newActor, statString) {
|
||||
const updates = {
|
||||
}
|
||||
@ -412,9 +420,9 @@ export class RdDStatBlockParser {
|
||||
actorData.taille = taille.value;
|
||||
}
|
||||
// Get weight
|
||||
const poids = XRegExp.exec(statString, XRegExp("(?<value>\\d+ kg)", 'giu'));
|
||||
const poids = XRegExp.exec(statString, XRegExp(",\\s+(?<value>\\d+)\\s+kg", 'giu'));
|
||||
if (poids?.value) {
|
||||
actorData.poids = poids.value;
|
||||
actorData.poids = poids.value + ' kg';
|
||||
}
|
||||
// Get cheveux
|
||||
const cheveux = XRegExp.exec(statString, XRegExp("kg,\\s+(?<value>[A-Za-zÀ-ÖØ-öø-ÿ\\s\\-]+),\\s+yeux", 'giu'));
|
||||
@ -435,7 +443,7 @@ export class RdDStatBlockParser {
|
||||
}
|
||||
|
||||
static parseCreature(statString, actorData) {
|
||||
let protection = XRegExp.exec(statString, XRegExp("protection\\s+(?<value>[\\-]?\\d+)", 'giu'));
|
||||
let protection = XRegExp.exec(statString, XRegExp("protection(\\s+naturelle)?\\s+(?<value>[\\-]?\\d+)", 'giu'));
|
||||
if (protection?.value) {
|
||||
actorData.attributs.protection.value = Number(protection.value);
|
||||
}
|
||||
@ -461,33 +469,40 @@ export class RdDStatBlockParser {
|
||||
}
|
||||
|
||||
static parseActorType(statString) {
|
||||
let niveau = XRegExp.exec(statString, XRegExp("Niveau\\s+(?<value>[\\+\\-]?\\d+)", 'giu'))
|
||||
let force = XRegExp.exec(statString, XRegExp("Force\\s+(?<value>[\\+\\-]?\\d+)", 'giu'))
|
||||
let vue = XRegExp.exec(statString, XRegExp("Vue\\s+(?<value>[\\+\\-]?\\d+)", 'giu'))
|
||||
let perception = XRegExp.exec(statString, XRegExp("perception\\s+(?<value>\\d+)", 'giu'))
|
||||
if (perception?.value) {
|
||||
return "creature"
|
||||
}
|
||||
if (niveau?.value) {
|
||||
if (!force) {
|
||||
return "entite"
|
||||
}
|
||||
if (!vue || perception) {
|
||||
return "creature"
|
||||
}
|
||||
return "personnage"
|
||||
}
|
||||
|
||||
static extractName(actorType, statString) {
|
||||
switch (actorType) {
|
||||
case "personnage":
|
||||
// Check if ',né le' is present
|
||||
let namePersonnage = "Importé"
|
||||
if (statString.includes(", né")) {
|
||||
// Name is all string before first comma ','
|
||||
namePersonnage = XRegExp.exec(statString, XRegExp("(?<value>[\\p{Letter}\\s\\d]+),", 'giu'));
|
||||
} else {
|
||||
namePersonnage = XRegExp.exec(statString, XRegExp("(?<value>[\\p{Letter}\\s\\d]+)\\s+TAILLE", 'giu'));
|
||||
}
|
||||
if (namePersonnage?.value) {
|
||||
return Misc.upperFirst(namePersonnage?.value);
|
||||
}
|
||||
if (actorType == "personnage") {
|
||||
// Check if ',né le' is present
|
||||
let namePersonnage = "Importé"
|
||||
if (statString.includes(", né")) {
|
||||
// Name is all string before first comma ','
|
||||
namePersonnage = XRegExp.exec(statString, XRegExp("(?<value>[\\p{Letter}\'\\-\\s\\d]+),", 'giu'));
|
||||
} else {
|
||||
namePersonnage = XRegExp.exec(statString, XRegExp("(?<value>[\\p{Letter}\'\\-\\s\\d]+)\\s+TAILLE", 'giu'));
|
||||
}
|
||||
if (namePersonnage?.value) {
|
||||
return Misc.upperFirst(namePersonnage?.value.toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
const name = XRegExp.exec(statString, XRegExp("(?<value>.+)\\s+taille", 'giu'));
|
||||
if (actorType == "entite") {
|
||||
if (!(name?.value)) {
|
||||
const nameEntiteReve = XRegExp.exec(statString, XRegExp("(?<value>.+)\\s+rêve", 'giu'));
|
||||
return Misc.upperFirst(nameEntiteReve?.value || "Importé");
|
||||
}
|
||||
}
|
||||
return Misc.upperFirst(name?.value || "Importé");
|
||||
}
|
||||
|
||||
|