Compare commits
	
		
			153 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 0456221cf7 | |||
| 583b4ff003 | |||
| b4ac906802 | |||
| 395c7a4cc3 | |||
| 27bc07f64a | |||
| 2f3ec7bab0 | |||
| 8d39a0526f | |||
| f83548b91e | |||
| 90d17a3477 | |||
| fb15f3eb38 | |||
| 4df0eab574 | |||
| c8d589f0d2 | |||
| d7470836a5 | |||
| 817fa8e62a | |||
| 0fe4f64343 | |||
| d6b5b0a550 | |||
| c9d87851bd | |||
| 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 | 
@@ -1,6 +1,6 @@
 | 
			
		||||
name: Release Creation
 | 
			
		||||
 | 
			
		||||
on: 
 | 
			
		||||
on:
 | 
			
		||||
  release:
 | 
			
		||||
    types: [published]
 | 
			
		||||
 | 
			
		||||
@@ -9,9 +9,11 @@ jobs:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    steps:
 | 
			
		||||
    - run: echo "💡 The ${{ gitea.repository }} repository will cloned to the runner."
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    #- 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
 | 
			
		||||
@@ -29,7 +31,7 @@ jobs:
 | 
			
		||||
        url: https://www.uberwald.me/gitea/${{gitea.repository}}
 | 
			
		||||
        manifest: https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/system.json
 | 
			
		||||
        download: https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/rddsystem.zip
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    - name: Set up Node.js
 | 
			
		||||
      uses: actions/setup-node@v2
 | 
			
		||||
      with:
 | 
			
		||||
@@ -37,7 +39,7 @@ jobs:
 | 
			
		||||
 | 
			
		||||
    - name: Install dependencies
 | 
			
		||||
      run: npm install
 | 
			
		||||
      
 | 
			
		||||
 | 
			
		||||
    - name: Build the compendiums
 | 
			
		||||
      run: node ./tools/packCompendiumsToDist.mjs
 | 
			
		||||
 | 
			
		||||
@@ -46,29 +48,29 @@ 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
 | 
			
		||||
      with:
 | 
			
		||||
        go-version: '>=1.20.1'
 | 
			
		||||
    
 | 
			
		||||
    - name: Use Go Action  
 | 
			
		||||
 | 
			
		||||
    - name: Use Go Action
 | 
			
		||||
      id: use-go-action
 | 
			
		||||
      uses: https://gitea.com/actions/release-action@main
 | 
			
		||||
      with:
 | 
			
		||||
        files: |-
 | 
			
		||||
          ./rddsystem.zip  
 | 
			
		||||
          ./rddsystem.zip
 | 
			
		||||
          system.json
 | 
			
		||||
        api_key: '${{secrets.ALLOW_PUSH_RELEASE}}'
 | 
			
		||||
 | 
			
		||||
    - name: Publish to Foundry server  
 | 
			
		||||
    - name: Publish to Foundry server
 | 
			
		||||
      uses: djlechuck/foundryvtt-publish-package-action@v1
 | 
			
		||||
      with:
 | 
			
		||||
        token: ${{ secrets.FOUNDRYVTT_RELEASE_TOKEN }}
 | 
			
		||||
        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
 | 
			
		||||
| 
		 Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB  | 
| 
		 Before Width: | Height: | Size: 193 KiB After Width: | Height: | Size: 193 KiB  | 
| 
		 Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB  | 
| 
		 Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB  | 
| 
		 Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB  | 
| 
		 Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB  | 
| 
		 Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 163 KiB  | 
| 
		 Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB  | 
| 
		 Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB  | 
| 
		 Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB  | 
| 
		 Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB  | 
| 
		 Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB  | 
| 
		 Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB  | 
| 
		 Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB  | 
| 
		 Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB  | 
| 
		 Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB  | 
| 
		 Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB  | 
| 
		 Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB  | 
| 
		 Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB  | 
| 
		 Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB  | 
| 
		 Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB  | 
| 
		 Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB  | 
| 
		 Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB  | 
| 
		 Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB  | 
| 
		 Before Width: | Height: | Size: 716 KiB After Width: | Height: | Size: 716 KiB  | 
| 
		 Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB  | 
| 
		 Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB  | 
| 
		 Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB  | 
| 
		 Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB  | 
| 
		 Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB  | 
| 
		 Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB  | 
| 
		 Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB  | 
| 
		 Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB  | 
| 
		 Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB  | 
| 
		 Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB  | 
| 
		 Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB  | 
| 
		 Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB  | 
| 
		 Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB  | 
| 
		 Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB  | 
| 
		 Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB  | 
| 
		 Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB  | 
| 
		 Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB  | 
| 
		 Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB  | 
| 
		 Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB  | 
| 
		 Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB  | 
| 
		 Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB  | 
| 
		 Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB  | 
| 
		 Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB  | 
| 
		 Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB  | 
| 
		 Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB  | 
| 
		 Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB  | 
| 
		 Before Width: | Height: | Size: 188 B After Width: | Height: | Size: 188 B  | 
| 
		 Before Width: | Height: | Size: 162 B After Width: | Height: | Size: 162 B  | 
| 
		 Before Width: | Height: | Size: 634 KiB After Width: | Height: | Size: 634 KiB  | 
| 
		 Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB  | 
| 
		 Before Width: | Height: | Size: 637 KiB After Width: | Height: | Size: 637 KiB  | 
							
								
								
									
										266
									
								
								changelog.md
									
									
									
									
									
								
							
							
						
						@@ -1,8 +1,190 @@
 | 
			
		||||
# 13.0
 | 
			
		||||
## 13.0.6 - Le bandage d'Illysis
 | 
			
		||||
 | 
			
		||||
- Les soins sont de nouveau disponibles depuis les tokens
 | 
			
		||||
- Correction des boutons de la feuille simplifiée
 | 
			
		||||
- On peut de nouveau acheter dans les commerces
 | 
			
		||||
 | 
			
		||||
## 13.0.5
 | 
			
		||||
 | 
			
		||||
- Export CSV/Scriptarium à nouveau disponible dans les menus d'acteurs
 | 
			
		||||
 | 
			
		||||
## 13.0.4 - Le long discours d'Illysis
 | 
			
		||||
 | 
			
		||||
- On peut de nouveau modifier les descriptions
 | 
			
		||||
- ne pas proposer l'export csv par défaut
 | 
			
		||||
- Correction de la macro "Jet quelconque"
 | 
			
		||||
- Correction de la ligne 'rêve actuel' ajoutée dans les caracs
 | 
			
		||||
- Corrections d'affichage
 | 
			
		||||
  - boutons de l'horloge
 | 
			
		||||
  - boutons de déplacement des TMR
 | 
			
		||||
  - modification des messages de tchat
 | 
			
		||||
 | 
			
		||||
## 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
 | 
			
		||||
@@ -23,12 +205,14 @@
 | 
			
		||||
  - 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
 | 
			
		||||
- les compétences de draconic ne sont plus précédées de "Voie de"
 | 
			
		||||
  - migration des compétences & compendiums
 | 
			
		||||
- Correction feuille simplifiée qui ne s'affichait pas en cas de sort variable
 | 
			
		||||
 | 
			
		||||
## 12.0.24 - Les ajustements d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- amélioration
 | 
			
		||||
  - meilleure gestion des noms des voies de draconic
 | 
			
		||||
  - affichage du détail des sorts avec le nom de voie, 'court', la difficulté, le coût
 | 
			
		||||
@@ -36,8 +220,9 @@
 | 
			
		||||
  - les tas dans les conteneurs peuvent être désempilés sans rendre le conteneur inutilisable
 | 
			
		||||
  - les conteneurs ne peuvent plus être empilés (pour éviter que le contenu de Schroedinger quand on les sépare)
 | 
			
		||||
  - on peut maintenant saisir et supprimer les bonus de cases de manière intuitive
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
## 12.0.23 - La bibliothèque d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- corrections mineures
 | 
			
		||||
  - meilleure gestion de la parade des armes naturelles
 | 
			
		||||
  - cas de "User lacks permission to update" pour les blessures et les StatusEffects
 | 
			
		||||
@@ -53,19 +238,23 @@
 | 
			
		||||
  - dans les compendiums, les compétences Écriture et Épée ont une majuscule accentuée. Les Épée dans le compendium d'équipements référence le nom de compétence accentué.
 | 
			
		||||
 | 
			
		||||
## 12.0.21 - La nomination d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- Les noms pour les messages dans le tchat sont maintenant ceux des tokens plutôt que ceux des acteurs
 | 
			
		||||
- Fix: le choix des effets dans les options s'affiche correctement
 | 
			
		||||
 | 
			
		||||
## 12.0.20 - Le tableau d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- Ecran d'accueil officiel Scriptarium
 | 
			
		||||
 | 
			
		||||
## 12.0.19 - La témérité d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- Fix
 | 
			
		||||
  - les défenses des créatures sont correctement filtrées
 | 
			
		||||
  - le lancer d'initiative pour tous les personnages/PNJs fonctionne correctement
 | 
			
		||||
  - les lieux et commerces n'ont pas d'initiative
 | 
			
		||||
 | 
			
		||||
## 12.0.18 - A la barbe d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- Améliorations sur la feuille de PNJ simplifiée
 | 
			
		||||
  - Ajout du portrait
 | 
			
		||||
  - Ajout du corps à corps
 | 
			
		||||
@@ -82,11 +271,13 @@
 | 
			
		||||
- Ajout d'un indicateur pour les armes de parade nécessitant une significative
 | 
			
		||||
 | 
			
		||||
## 12.0.16 - Le secret d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- Fix: les jets envoyés messages uniquement au MJ ne sont plus envoyés à tous les autres joueurs (et dupliqués)
 | 
			
		||||
- Les noms affichés dans les automatisations de combat sont maintenant ceux des tokens plutôt que ceux des acteurs
 | 
			
		||||
- Ajout d'une option pour la localisation des blessures
 | 
			
		||||
 | 
			
		||||
## 12.0.15 - Le messager d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- Correction des faces de dés personalisés dice-so-nice
 | 
			
		||||
- Les messages de maladies ne sont plus publics
 | 
			
		||||
- Les messages privés dans les TMR sont aussi envoyés au GM
 | 
			
		||||
@@ -94,6 +285,7 @@
 | 
			
		||||
- Amélioration du rendu des tables de compendiums (commande /table)
 | 
			
		||||
 | 
			
		||||
## 12.0.14 - Les légions d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- Feuille de PNJ:
 | 
			
		||||
  - boutons standard (encaissement, ...)
 | 
			
		||||
  - boutons pour ajuster les compteurs
 | 
			
		||||
@@ -102,15 +294,18 @@
 | 
			
		||||
  - gestion des armes
 | 
			
		||||
 | 
			
		||||
## 12.0.13 - La Chance d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- Fix: jets de caractéristiques
 | 
			
		||||
 | 
			
		||||
## 12.0.12 - L'étalage d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- Fix: On peut de nouveau vendre des items sans propriétaire, depuis les compendiums ou depuis l'onglet des Objets
 | 
			
		||||
- Début de Feuille PNJ au format des encarts Scriptarium
 | 
			
		||||
  - support des jets de caractéristiques
 | 
			
		||||
  - support des jets de compétences
 | 
			
		||||
 | 
			
		||||
## 12.0.11 - Le scriptorium d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- ajout d'un bouton pour générer les éléments de description d'un personnage
 | 
			
		||||
- ajout du logo en background dans la liste des systèmes Foundry
 | 
			
		||||
- ajout d'un champ pour le métier
 | 
			
		||||
@@ -119,10 +314,12 @@
 | 
			
		||||
  - export de l'esquive avec armure et sans armure
 | 
			
		||||
 | 
			
		||||
## 12.0.9 - 12.0.10 - Le scriptorium d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- corrections de l'export scriptarium
 | 
			
		||||
- 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/...
 | 
			
		||||
- Ecaille d'efficacité
 | 
			
		||||
  - l'écaille d'efficacité est prise en compte même si on n'utilise pas le ciblage en combat
 | 
			
		||||
@@ -132,6 +329,7 @@
 | 
			
		||||
  - le tooltip de l'initiative affiche correctement l'initiative
 | 
			
		||||
 | 
			
		||||
## 12.0.7 - La propriété d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- correction des opérations faites à la création d'un Item:
 | 
			
		||||
  - la durée des queues/rencontres/souffles
 | 
			
		||||
  - les effets draconiques d'un souffle/queue
 | 
			
		||||
@@ -146,8 +344,9 @@
 | 
			
		||||
- la commande /voyage affiche maintenant les compétences liées au terrain
 | 
			
		||||
 | 
			
		||||
## 12.0.6 - Le bazar d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- Corrections de l'inventaire en bazar:
 | 
			
		||||
  - un problème pouvait survenir en déplaçant les objets 
 | 
			
		||||
  - un problème pouvait survenir en déplaçant les objets
 | 
			
		||||
    l'inventaire, qui fait qu'un conteneur se retrouve récursivement dans son
 | 
			
		||||
    propre contenu, ce qui empêche d'ouvrir la feuille d'acteur.
 | 
			
		||||
  - un objet non-conteneur pouvait dans certains cas avoir un pseudo contenu
 | 
			
		||||
@@ -155,27 +354,31 @@
 | 
			
		||||
    conteneur (et donc non affiché)
 | 
			
		||||
  - vider les conteneurs supprime correctement toutes les informations liées
 | 
			
		||||
    aux conteneurs/contenus
 | 
			
		||||
- Les messages pour les tirages dans le compendium utilisent le "roll mode" 
 | 
			
		||||
- Les messages pour les tirages dans le compendium utilisent le "roll mode"
 | 
			
		||||
  courant pour leur visibilité
 | 
			
		||||
- Fix: restaurer la compatibilité Foundry 11
 | 
			
		||||
 | 
			
		||||
## 12.0.5 - Les mauvais jours d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- Fix: on peut de nouveau ouvrir l'édition de calendrier
 | 
			
		||||
- Fix: on ne peut plus ouvrir plusieurs fenêtres de lancer de sort
 | 
			
		||||
- Fix: Failed to execute 'getComputedStyle' on 'Window'
 | 
			
		||||
 | 
			
		||||
## 12.0.4 - La plaie d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- **Support V12**
 | 
			
		||||
  - Fix: les boutons d'encaissement dans le tchat fonctionnent de nouveau
 | 
			
		||||
  - Fix warnings sur "Die" et AudioHelper
 | 
			
		||||
 | 
			
		||||
## 12.0.3 - L'hémorragie d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- **Support V12**
 | 
			
		||||
  - On peut de nouveau ouvrir un acteur blessé après redémarrage du monde
 | 
			
		||||
  - On peut de nouveau ouvrir les Items avec une rareté par environnement
 | 
			
		||||
  - Le choix de ne plus afficher les demandes de suppression est bien pris en compte
 | 
			
		||||
 | 
			
		||||
## 12.0.2 - Les pluies d'Astrobazzarh
 | 
			
		||||
 | 
			
		||||
- **Support V12**
 | 
			
		||||
  - correction des actions techniques déleguées au MJ qui bloquaient les fenêtre de lancer de dés des joueurs (et plein d'autres)
 | 
			
		||||
  - la fenêtre de calendrier s'ouvre correctement
 | 
			
		||||
@@ -190,13 +393,16 @@
 | 
			
		||||
  - correction d'erreurs intempestives 'User ... lacks permission to update ...'
 | 
			
		||||
 | 
			
		||||
# 11.2
 | 
			
		||||
 | 
			
		||||
## 11.2.21 - Le questionnement d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- Une confirmation spécifique est demandée pour monter dans les terres médianes en cas de rencontre en attente
 | 
			
		||||
- L'expérience en caractéristique sur les jets de chance et rêve actuels est mise dans la caractéristique correspondante
 | 
			
		||||
- Les effets s'appliquent correctement sur les créatures
 | 
			
		||||
- La date et l'heure (draconiques) sont affichées dans les messages du tchat
 | 
			
		||||
 | 
			
		||||
## 11.2.20 - Le soulagement d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- L'option "ajout de la difficulté d'attaque à l'encaissement" est affichée comme un modificateur d'encaissement
 | 
			
		||||
- Les options d'encaissement alternatives fonctionnent avec la validation de l'encaissement par le gardien
 | 
			
		||||
- La fenêtre d'astrologie du gardien affiche toutes les heures lues par un personnage
 | 
			
		||||
@@ -206,12 +412,15 @@
 | 
			
		||||
- Les messages de récupération de rêve en cas de Rêve de Dragon sont clarifiés
 | 
			
		||||
 | 
			
		||||
## 11.2.19 - Les hémorroïdes d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- La validation des jets d'encaissement par le Gardien fonctionne de nouveau
 | 
			
		||||
 | 
			
		||||
## 11.2.18 - Le bourrichon d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- Les différentes listes de la feuille de personnage ont maintenant le bouton pour envoyer dans le tchat
 | 
			
		||||
 | 
			
		||||
## 11.2.17 - Le cache-oeil d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- Le titre des fenêtre d'objet affiche de nouveau le type traduit
 | 
			
		||||
- Les tooltips des boutons edit/delete sont maintenant en Français
 | 
			
		||||
- La case à cocher "Cacher les points de tâches" fonctionne de nouveau
 | 
			
		||||
@@ -220,37 +429,45 @@
 | 
			
		||||
- La fenêtre des TMRs ne devrait plus afficher une zone noire au lieu de la carte.
 | 
			
		||||
 | 
			
		||||
## 11.2.16 - Le Tri d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- Tri alphabétique des items dans la fenêtre de création
 | 
			
		||||
- Mise à jour comptage de monde
 | 
			
		||||
 | 
			
		||||
## 11.2.15 - La Table d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- Tirage automatique de la foce d'une rencontre (via la commande /tmrr)
 | 
			
		||||
- Ajout de boutons pour ajouter des blessures "complètes" (ie avec perte d'endurance/vie)
 | 
			
		||||
 | 
			
		||||
## 11.2.14 - Les petits pas d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- Correction sur la gestion de la surprise
 | 
			
		||||
- Ordre des messages sur les cases humides
 | 
			
		||||
 | 
			
		||||
## 11.2.13 - Les cent pas d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- Ajout de la commande /voyage pour gérer la fatigue de marche des voyageurs
 | 
			
		||||
 | 
			
		||||
## 11.2.12 - Le somnifère  d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- Fix: les potions enchantées n'empêchent plus de finir correctement Château Dormant
 | 
			
		||||
 | 
			
		||||
## 11.2.11 - Le miroir d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- Changement des images de compétence de créatures morsure/pinces pour être dans le thème
 | 
			
		||||
- Suppression de la bordure autour des portraits d'acteurs, remplacés par un légèr éclaircissement du fond
 | 
			
		||||
- Fix: le refoulement ajoute correctement un souffle et revient à 0 en cas d'échec
 | 
			
		||||
 | 
			
		||||
## 11.2.10 - Les expériences d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- En cas d'expérience des caractéristiques dérivées,
 | 
			
		||||
  - si plusieurs caractéristiques pourraient recevoir l'expérience, une fenêtre demande au joueur
 | 
			
		||||
  - si une seule caractéristique peut recevoir de l'expérience, c'est attribué automatiquement
 | 
			
		||||
- Si la force est au maximum pour la taille personnage, on ne peut plus gagner d'expérience
 | 
			
		||||
 | 
			
		||||
## 11.2.9 - La barbe d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- Amélioration des textes de tooltips
 | 
			
		||||
- Les tooltips sont plus dans le thème de couleur du système Rêve de Dragon 
 | 
			
		||||
- Les tooltips sont plus dans le thème de couleur du système Rêve de Dragon
 | 
			
		||||
- Ajouts d'icones pour les attaque/initiative/soins dans les raccourcis sur les tokens (HUD)
 | 
			
		||||
- Ajout d'une icône et transformation en bouton du lien pour accéder à l'astrologie et aux chiffres astraux
 | 
			
		||||
- Suppression de message de log inutile sur chaque point de coeur
 | 
			
		||||
@@ -260,19 +477,23 @@
 | 
			
		||||
- Changement de l'icône d'état d'empoignade pour suivre les couleurs des autres icônes d'état
 | 
			
		||||
 | 
			
		||||
## 11.2.8 - L'éclairage d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- l'ajustement de la lumière jour/nuit s'étale sur moins de temps (vaisseau et Lyre)
 | 
			
		||||
- les nouveaux tooltips ne masquent plus l'information d'expérience
 | 
			
		||||
- les jets de dés pour maîtriser les rencontres fonctionnent de nouveau
 | 
			
		||||
 | 
			
		||||
## 11.2.7 - Les explications d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- Ajout de tooltips sur la plupart des boutons, liens clickables, objets, tâches, ...
 | 
			
		||||
- Fix: on peut de nouveau regarder l'inventaire avec les droits limités/observateur
 | 
			
		||||
 | 
			
		||||
## 11.2.6 - Les réveils difficiles d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- Les changements de points de Cœur sont temporaires jusqu'à fin Château Dormant
 | 
			
		||||
- Fix: tous les petits fixes (feuille qui s'ouvre plus, compagnons animaux, potions qui bloquent Château Dormant, ...)
 | 
			
		||||
 | 
			
		||||
## 11.2.2 - Les tendres moments d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- On peut maintenant avoir des points de Cœur pour des suivants/compagnons
 | 
			
		||||
  - diminuer les points de coeurs fait perdre du moral
 | 
			
		||||
  - on peut proposer un tendre moment
 | 
			
		||||
@@ -291,11 +512,14 @@
 | 
			
		||||
    ne bloquent plus les jets de dés
 | 
			
		||||
 | 
			
		||||
## v11.2.1 - La technique d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- On peut créer des armes pour Corps à corps et Esquive. Barreaux de chaise, armes improvisées, techniques d'art martiaux, pas de côté pour faire trébucher l'adversaire... A vous de voir comment imaginer de nouvelles "armes".
 | 
			
		||||
- Les armes avec une résistance de 0 ne peuvent pas être utilisées, une image et un rappel indiquent qu'elles sont cassées
 | 
			
		||||
 | 
			
		||||
Vu qu'elles ne peuvent pas être utilisées, permet de savoir pourquoi
 | 
			
		||||
 | 
			
		||||
## v11.2.0 - Les Terres médianes d'Akarlikarlikar
 | 
			
		||||
 | 
			
		||||
- Les TMRs sont redimensionables
 | 
			
		||||
- Nouveaux graphismes plus lisibles dans les TMRs
 | 
			
		||||
- Nouveau code couleur des icônes dans les TMR:
 | 
			
		||||
@@ -309,12 +533,15 @@ Vu qu'elles ne peuvent pas être utilisées, permet de savoir pourquoi
 | 
			
		||||
- Fix: Les jets d'encaissement forcés par le gardien à un résultat inférieur à 11 ne peuvent plus donner un deuxième d10 négatif
 | 
			
		||||
 | 
			
		||||
# v11.1
 | 
			
		||||
 | 
			
		||||
## v11.1.6 - Les dissections de Werther de Zloth
 | 
			
		||||
 | 
			
		||||
- Fix: on peut de nouveau donner des compétences aux créatures
 | 
			
		||||
- Fix: le délai de guérison d'une blessure rétrogradée est correctement appliqué
 | 
			
		||||
- Fix: l'encaissement à valider par le MJ fonctionne de nouveau
 | 
			
		||||
 | 
			
		||||
## v11.1.5 - Werther de Zloth l'Onirique
 | 
			
		||||
 | 
			
		||||
- Fixes:
 | 
			
		||||
  - la demande de défense ne marchait plus
 | 
			
		||||
  - la tête réserve extensible crée bien une case de réserve extensible (à modifier)
 | 
			
		||||
@@ -329,6 +556,7 @@ Vu qu'elles ne peuvent pas être utilisées, permet de savoir pourquoi
 | 
			
		||||
  - pas de jets de vie pour les morts
 | 
			
		||||
 | 
			
		||||
## v11.1.4 - Werther de Zloth l'Onirique
 | 
			
		||||
 | 
			
		||||
- Ajout du facteur de significative à côté du pourcentage dans le résultat des jets de dés pour rappeler que le pourcentage n'est pas diviasé
 | 
			
		||||
- Fix: dans les TMRs, les tooltips affichent bien les informations de tous les effets sur la case
 | 
			
		||||
- Fix: la fatigue et l'éthylisme sont de nouveau pris en compte dans le calcul de l'éthylisme
 | 
			
		||||
@@ -338,15 +566,18 @@ Vu qu'elles ne peuvent pas être utilisées, permet de savoir pourquoi
 | 
			
		||||
- Esthétique: ne pas afficher "+0" pour les ajustements de jets/encaissement
 | 
			
		||||
 | 
			
		||||
## v11.1.2 - Les vertèbres de Werther de Zloth
 | 
			
		||||
 | 
			
		||||
- Fix: les jets d'encaissement fonctionnent de nouveau normalement
 | 
			
		||||
- Macro "Mon personnage" permettant au joueur d'accéder à sa feuille de personnage depuis la barre de macros
 | 
			
		||||
 | 
			
		||||
## v11.1.1 - Les fumebols de Werther de Zloth
 | 
			
		||||
 | 
			
		||||
- Fix: on peut de nouveau afficher les vues détaillées
 | 
			
		||||
- Fix: on peut ouvrir les sacs et contenants portés par les véhicules et créatures
 | 
			
		||||
- Fix: cuisiner du gibier prend maintenant bien les proportaions en compte
 | 
			
		||||
 | 
			
		||||
## v11.1.0 - Les choix de Werther de Zloth
 | 
			
		||||
 | 
			
		||||
- Les options suivantes peuvent être désactivées:
 | 
			
		||||
  - La transformation de stress à Château Dormant
 | 
			
		||||
  - La récuperation de chance à Château Dormant
 | 
			
		||||
@@ -364,24 +595,28 @@ Vu qu'elles ne peuvent pas être utilisées, permet de savoir pourquoi
 | 
			
		||||
  - en cas de charge, les particulières sont toujours en force (p125)
 | 
			
		||||
 | 
			
		||||
# v11.0
 | 
			
		||||
 | 
			
		||||
## v11.0.28 - les fractures de Khrachtchoum
 | 
			
		||||
 | 
			
		||||
- La gravité de la blessure est affichée dans le résumé de l'encaissement
 | 
			
		||||
- Lors du changement d'acteur pendant le round
 | 
			
		||||
  - le message annonçant le joueur dont c'est le tour ne contient plus d'informations de santé
 | 
			
		||||
  - un message avec les informations de santé est envoyé au Gardienn et au propriétaire du token.acteur
 | 
			
		||||
  - le jet de vie est bien fait par le token si besoin
 | 
			
		||||
  - seul les propriétaires peuvent faire les jets de vie 
 | 
			
		||||
  - seul les propriétaires peuvent faire les jets de vie
 | 
			
		||||
- Amélioration de la fenêtre de jets
 | 
			
		||||
  - le type de dégâts pour les attaques est toujours affiché
 | 
			
		||||
  - le moral est indiqué avant l'icone d'appel au moral
 | 
			
		||||
 | 
			
		||||
## v11.0.27 - Khrachtchoum le méticuleux
 | 
			
		||||
 | 
			
		||||
- le tooltip dans les TMR reste visible si on ne bouge pas la souris
 | 
			
		||||
- le surencombrement n'affecte QUE les actions physiques
 | 
			
		||||
- on peut de nouveau fabriquer une potion depuis la fenêtre d'édition de l'herbe
 | 
			
		||||
- si les TMR sont minimisées alors qu'une action est requise, elles sont bien réaffichées lorsque l'action est faite
 | 
			
		||||
 | 
			
		||||
## v11.0.26 - le crépuscule de Khrachtchoum
 | 
			
		||||
 | 
			
		||||
- gestion correcte des TMRs
 | 
			
		||||
  - les TMRs ne sont jamais minimisées (par le système) quand le haut-rêvant est en demi-rêve
 | 
			
		||||
  - lorsqu'une fenêtre liée aux demi-rêve est affichée, cliquer sur les TMRs n'a pas d'effet
 | 
			
		||||
@@ -400,45 +635,57 @@ Vu qu'elles ne peuvent pas être utilisées, permet de savoir pourquoi
 | 
			
		||||
- les jets de compétences d'attaque des créatures fonctionnent de nouveau
 | 
			
		||||
 | 
			
		||||
## v11.0.25 - la vision du rêve de Khrachtchoum
 | 
			
		||||
 | 
			
		||||
- Les TMRs restent affichées tant que le Haut-rêvant est en demi-rêve
 | 
			
		||||
 | 
			
		||||
## v11.0.24 - les couleurs de Khrachtchoum
 | 
			
		||||
 | 
			
		||||
- nouvelle carte des TMRs
 | 
			
		||||
 | 
			
		||||
## v11.0.23 - la lumière de Khrachtchoum
 | 
			
		||||
 | 
			
		||||
- ajustement automatique de la luminosité selon l'heure pour les scènes:
 | 
			
		||||
   - avec une vision des tokens (sinon: ce n'est pas une scène de carte pour tokens)
 | 
			
		||||
   - avec illumination globale (correspondant à une illumination extérieure)
 | 
			
		||||
   - quand lampe "allumée" dans la fenêtre du calendrier
 | 
			
		||||
  - avec une vision des tokens (sinon: ce n'est pas une scène de carte pour tokens)
 | 
			
		||||
  - avec illumination globale (correspondant à une illumination extérieure)
 | 
			
		||||
  - quand lampe "allumée" dans la fenêtre du calendrier
 | 
			
		||||
 | 
			
		||||
## v11.0.22 - les automatismes de Khrachtchoum le Problémeux
 | 
			
		||||
 | 
			
		||||
- Macro pour attaquer avec les compétences de créatures
 | 
			
		||||
 | 
			
		||||
## v11.0.20
 | 
			
		||||
 | 
			
		||||
- Macro pour attaquer avec les armes des personnages
 | 
			
		||||
 | 
			
		||||
## v11.0.17
 | 
			
		||||
 | 
			
		||||
- Fix: les actions de commerce ne s'appliquait pas bien aux personnages des tokens non liés
 | 
			
		||||
 | 
			
		||||
## v11.0.15 - L'apprentissage de Khrachtchoum
 | 
			
		||||
 | 
			
		||||
- Fix: l'expérience ne s'appliquait plus sur certaines réussites particulières (régression depuis la 11.0.7)
 | 
			
		||||
 | 
			
		||||
## v11.0.14 - Les pincettes de Khrachtchoum le Problémeux
 | 
			
		||||
 | 
			
		||||
- Correction du calcul de la place restante lors de l'ajout dans un conteneur
 | 
			
		||||
 | 
			
		||||
## v11.0.13 - La multiplication de l'eau de Khrachtchoum le Problémeux
 | 
			
		||||
 | 
			
		||||
- Correction de la vente depuis un commerce ayant des quantités illimitées
 | 
			
		||||
 | 
			
		||||
## v11.0.12 - Les poids de la mesure de Khrachtchoum le Problémeux
 | 
			
		||||
 | 
			
		||||
- Correction des malus de surencombrement
 | 
			
		||||
- Le malus armure est correctement affiché dans l'onglet des caractéristiques
 | 
			
		||||
- Correction d'orthographe et amélioration des messages des oeuvres d'art
 | 
			
		||||
 | 
			
		||||
## v11.0.11 - Les bleus de Khrachtchoum le Problémeux
 | 
			
		||||
 | 
			
		||||
- si le gardien configure le sommeil, les joueurs sont notifiés que chateau dormant vient de passer
 | 
			
		||||
- possibilité de créer des armes et des compétences de créatures non-mortelles.
 | 
			
		||||
 | 
			
		||||
## v11.0.10 - Les Songes de Khrachtchoum le Problémeux
 | 
			
		||||
 | 
			
		||||
- on peut de nouveau se déplacer dans les TMRs d'un clic sur la case à atteindre
 | 
			
		||||
- Lire un livre depuis l'inventaire permet de nouveau de faire un jet de la tâche
 | 
			
		||||
  créée au lieu de créer toujours une nouvelle tâche
 | 
			
		||||
@@ -449,12 +696,14 @@ Vu qu'elles ne peuvent pas être utilisées, permet de savoir pourquoi
 | 
			
		||||
  les heures dormies sont déduites des heures restant à dormir
 | 
			
		||||
 | 
			
		||||
## v11.0.9 - Les Souvenirs de Khrachtchoum le Problémeux
 | 
			
		||||
 | 
			
		||||
- mode de saisie de l'archétype en vue détaillée
 | 
			
		||||
- création  une nouvelle incarnation depuis l'archétype
 | 
			
		||||
- réorganisation de la fenêtre de sélection des règles optionnelles
 | 
			
		||||
- correction de l'affichage du type dans les fenêtres d'objets
 | 
			
		||||
 | 
			
		||||
## v11.0.8 - la poigne de Sémolosse
 | 
			
		||||
 | 
			
		||||
- lien vers le changelog
 | 
			
		||||
- organisation des compendiums du système
 | 
			
		||||
- correction de l'empoignade
 | 
			
		||||
@@ -477,4 +726,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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2502
									
								
								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 */
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										2115
									
								
								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('.roll-chance-actuelle').click(async event => this.actor.rollCarac('chance-actuelle'))
 | 
			
		||||
    this.html.find('.roll-chance-actuelle').click(async event => await this.actor.rollCarac('chance-actuelle'))
 | 
			
		||||
    this.html.find('.button-appel-chance').click(async event => 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('.sortreserve-add').click(async event => this.actor.addSortReserve(RdDSheetUtility.getItemId(event)))
 | 
			
		||||
      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,27 +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('.chance-actuelle-plus').click(async event => this.actor.chanceActuelleIncDec(1))
 | 
			
		||||
    this.html.find('.chance-actuelle-moins').click(async event => this.actor.chanceActuelleIncDec(-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) {
 | 
			
		||||
@@ -324,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>`
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										618
									
								
								module/actor.js
									
									
									
									
									
								
							
							
						
						@@ -1,5 +1,6 @@
 | 
			
		||||
import { RdDTextEditor } from "../apps/rdd-text-roll-editor.js";
 | 
			
		||||
import { Grammar } from "../grammar.js";
 | 
			
		||||
import { ITEM_TYPES } from "../item.js";
 | 
			
		||||
import { ITEM_TYPES } from "../constants.js";
 | 
			
		||||
import { RdDSheetUtility } from "../rdd-sheet-utility.js";
 | 
			
		||||
import { RdDBaseActorSheet } from "./base-actor-sheet.js";
 | 
			
		||||
 | 
			
		||||
@@ -25,16 +26,17 @@ 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 =>
 | 
			
		||||
@@ -47,18 +49,20 @@ export class RdDBaseActorReveSheet extends RdDBaseActorSheet {
 | 
			
		||||
        }
 | 
			
		||||
      }], { 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.", "");
 | 
			
		||||
        this.actor.updateCarac(caracName, parseInt(event.target.value));
 | 
			
		||||
        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;
 | 
			
		||||
        //console.log("Competence changed :", compName);
 | 
			
		||||
        this.actor.updateCompetence(compName, parseInt(event.target.value));
 | 
			
		||||
        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,59 @@ 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',
 | 
			
		||||
      name: 'jet-quelconque',
 | 
			
		||||
      label: 'Jet',
 | 
			
		||||
      template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll.hbs',
 | 
			
		||||
      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 +411,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 +522,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 +532,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 +545,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 +557,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,109 +81,51 @@ 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)
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  itemActionEdit(event) {
 | 
			
		||||
    const item = this.getItem(event);
 | 
			
		||||
    return item?.sheet.render(true);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  _rechercherKeyup(event) {
 | 
			
		||||
    const currentTarget = event.currentTarget;
 | 
			
		||||
    const nouvelleRecherche = this._optionRecherche(currentTarget);
 | 
			
		||||
@@ -245,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':
 | 
			
		||||
@@ -211,6 +213,7 @@ export class RdDBaseActor extends Actor {
 | 
			
		||||
  isCreatureEntite() { return this.isCreature() || this.isEntite() }
 | 
			
		||||
  isCreature() { return false }
 | 
			
		||||
  isEntite(typeentite = []) { return false }
 | 
			
		||||
  isHautRevant() { return false }
 | 
			
		||||
  isVehicule() { return false }
 | 
			
		||||
  isPersonnage() { return false }
 | 
			
		||||
  getItem(id, type = undefined) {
 | 
			
		||||
@@ -242,16 +245,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) {
 | 
			
		||||
@@ -412,7 +418,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) {
 | 
			
		||||
@@ -729,31 +735,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
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -8,13 +8,15 @@ 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
 | 
			
		||||
@@ -31,19 +33,15 @@ 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));
 | 
			
		||||
      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));
 | 
			
		||||
    })
 | 
			
		||||
    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 =>
 | 
			
		||||
      DialogSelect.select({
 | 
			
		||||
      await DialogSelect.select({
 | 
			
		||||
        label: "Choisir un acteur à accorder",
 | 
			
		||||
        list: game.actors.filter(it => it.isPersonnage() && it.prototypeToken.actorLink)
 | 
			
		||||
      },
 | 
			
		||||
 
 | 
			
		||||
@@ -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 {
 | 
			
		||||
 | 
			
		||||
@@ -12,14 +12,18 @@ export class ExportScriptarium {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  constructor() {
 | 
			
		||||
    Hooks.on("getActorDirectoryFolderContext", (actorDirectory, menus) => { ExportScriptarium.INSTANCE.onActorDirectoryMenu(actorDirectory, menus) })
 | 
			
		||||
    Hooks.on("getActorDirectoryEntryContext", (actorDirectory, menus) => { ExportScriptarium.INSTANCE.onActorDirectoryMenu(actorDirectory, menus) })
 | 
			
		||||
    //Hooks.on("getActorDirectoryFolderContext", (actorDirectory, menus) => { ExportScriptarium.INSTANCE.onActorDirectoryMenu(actorDirectory, menus) })
 | 
			
		||||
    Hooks.on("getFolderContextOptions", (actorDirectory, menus) => { ExportScriptarium.INSTANCE.onActorDirectoryMenu(actorDirectory, menus) })
 | 
			
		||||
    //Hooks.on("getActorDirectoryEntryContext", (actorDirectory, menus) => { ExportScriptarium.INSTANCE.onActorDirectoryMenu(actorDirectory, menus) })
 | 
			
		||||
    Hooks.on("getActorContextOptions", (actorDirectory, menus) => { ExportScriptarium.INSTANCE.onActorDirectoryMenu(actorDirectory, menus) })
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  onActorDirectoryMenu(actorDirectory, menus) {
 | 
			
		||||
    // DEBUG console.log("ExportScriptarium.onActorDirectoryMenu", actorDirectory, menus)
 | 
			
		||||
    menus.push({
 | 
			
		||||
      name: 'Export Personnages <i class="fa-regular fa-file-csv"></i>',
 | 
			
		||||
      icon: IMG_SCRIPTARIUM,
 | 
			
		||||
      name: 'Export Personnages',
 | 
			
		||||
      icon: '<i class="fa-solid fa-download"></i>', //IMG_SCRIPTARIUM,
 | 
			
		||||
      condition: (target) => game.user.isGM &&
 | 
			
		||||
        OptionsAvancees.isUsing(EXPORT_CSV_SCRIPTARIUM) &&
 | 
			
		||||
        this.$getActors(actorDirectory, target).length > 0,
 | 
			
		||||
@@ -28,22 +32,28 @@ export class ExportScriptarium {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  $getTargetName(actorDirectory, target) {
 | 
			
		||||
    target = $(target)
 | 
			
		||||
    const li = target.closest(".directory-item")
 | 
			
		||||
    const folderId = li.data("folderId")
 | 
			
		||||
    const actorId = li.data("documentId")
 | 
			
		||||
    const actorId = li.data("entryId")
 | 
			
		||||
    return actorId
 | 
			
		||||
      ? game.actors.get(actorId).name
 | 
			
		||||
      : actorDirectory.folders.find(it => it.id == folderId).name
 | 
			
		||||
      : actorDirectory.collection.filter(it => it.folder.id == folderId).name
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  $getActors(actorDirectory, target) {
 | 
			
		||||
    if (actorDirectory.id != "actors") {
 | 
			
		||||
      return []
 | 
			
		||||
    }
 | 
			
		||||
    // DEBUG console.log("ExportScriptarium.$getActors", actorDirectory, target)
 | 
			
		||||
    target = $(target)
 | 
			
		||||
    const li = target.closest(".directory-item")
 | 
			
		||||
    const folderId = li.data("folderId")
 | 
			
		||||
    const actorId = li.data("documentId")
 | 
			
		||||
    const actorId = li.data("entryId")
 | 
			
		||||
    const actors = actorId
 | 
			
		||||
      ? [game.actors.get(actorId)]
 | 
			
		||||
      : folderId
 | 
			
		||||
        ? actorDirectory.folders.find(it => it.id == folderId).contents
 | 
			
		||||
        ? actorDirectory.collection.filter(it => it.folder.id == folderId)
 | 
			
		||||
        : []
 | 
			
		||||
    return actors.filter(it => it.type == ACTOR_TYPES.personnage)
 | 
			
		||||
  }
 | 
			
		||||
@@ -54,7 +64,7 @@ export class ExportScriptarium {
 | 
			
		||||
    const actorLines = actors.map(actor => Misc.join(this.getActorLine(actor), ';'))
 | 
			
		||||
    const data = Misc.join([header, ...actorLines], eol)
 | 
			
		||||
    const filename = `scriptarium-${targetName?.slugify()}.csv`;
 | 
			
		||||
    saveDataToFile(data, "text/csv;charset=windows-1252", `${filename}`);
 | 
			
		||||
    foundry.utils.saveDataToFile(data, "text/csv;charset=windows-1252", `${filename}`);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  getHeaderLine() {
 | 
			
		||||
 
 | 
			
		||||
@@ -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"
 | 
			
		||||
@@ -279,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+"
 | 
			
		||||
@@ -33,7 +34,6 @@ const XREGEXP_WEAPON_MANIEMENT = "(?<maniement>(" + Misc.join(Object.keys(MANIEM
 | 
			
		||||
 | 
			
		||||
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)
 | 
			
		||||
  }
 | 
			
		||||
@@ -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.toLowerCase());
 | 
			
		||||
        }
 | 
			
		||||
    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é");
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||