Compare commits
	
		
			12 Commits
		
	
	
		
			b16c5b6f85
			...
			12.0.43
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 921e470498 | |||
| 0009876a6d | |||
| 54785f0c3a | |||
| df76c4bd78 | |||
| 5f3c678195 | |||
| 89bbe63340 | |||
| 149990e352 | |||
| 3e355784c7 | |||
| b92055d5dd | |||
| 220f8142f5 | |||
| a8bb00ad0b | |||
| 78e30b5503 | 
| @@ -1,6 +1,6 @@ | ||||
| name: Release Creation | ||||
|  | ||||
| on: | ||||
| on:  | ||||
|   release: | ||||
|     types: [published] | ||||
|  | ||||
| @@ -9,11 +9,9 @@ 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 | ||||
| @@ -31,7 +29,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: | ||||
| @@ -39,7 +37,7 @@ jobs: | ||||
|  | ||||
|     - name: Install dependencies | ||||
|       run: npm install | ||||
|  | ||||
|        | ||||
|     - name: Build the compendiums | ||||
|       run: node ./tools/packCompendiumsToDist.mjs | ||||
|  | ||||
| @@ -48,29 +46,29 @@ jobs: | ||||
|          apt update -y | ||||
|          apt install -y zip | ||||
|  | ||||
|     - run: zip -r ./rddsystem.zip system.json template.json README.md LICENSE.txt assets/ css/ fonts/ icons lang/ module/ packs/ pic/ sounds/ styles/ templates/ | ||||
|  | ||||
|     - run: zip -r ./rddsystem.zip system.json template.json README.md LICENSE.txt assets/ fonts/ icons lang/ module/ packs/ pic/ sounds/ styles/ templates/  | ||||
|      | ||||
|     - name: setup go | ||||
|       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/v13/changelog.md' | ||||
|         compatibility-minimum: '13' | ||||
|         compatibility-verified: '13' | ||||
|         notes: 'https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md' | ||||
|         compatibility-minimum: '12' | ||||
|         compatibility-verified: '12' | ||||
							
								
								
									
										0
									
								
								.gitlab/.gitkeep
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										0
									
								
								.gitlab/issue_templates/.gitkeep
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										14
									
								
								.gitlab/issue_templates/Bug.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,14 @@ | ||||
| Pour que le bug soit traité, merci de préciser quelques détails. | ||||
|  | ||||
| ### Environment | ||||
|  | ||||
| > Indiquez quelques éléments de votre installation | ||||
|  | ||||
| * Foundry VTT Version: (Example 0.5.4) | ||||
| * OS: [Windows, MacOS, Linux (which distro)] | ||||
| * Modules ?: Liste des modules utilisés | ||||
|  | ||||
| ### Description du problème | ||||
|  | ||||
|  | ||||
| /label ~Bug ~Nonrepro | ||||
							
								
								
									
										14
									
								
								.gitlab/issue_templates/Feature.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,14 @@ | ||||
|  | ||||
| ### Résumé de la fonctionnalité | ||||
|  | ||||
| > Décrivez de manière simple et concise la fonction que vous voulez voir ajoutée. | ||||
|  | ||||
| ### Expérience Utilisateur | ||||
|  | ||||
| > Indiquez ce que l'utilisateur aura comme bénéfice avec cette fonction. | ||||
|  | ||||
| ### Priority/Importance | ||||
|  | ||||
| > Selon vous, quelle est l'importance de cette fonctionnalité. | ||||
|  | ||||
| /label ~Feature | ||||
| @@ -12,8 +12,8 @@ Pseudo : LeRatierBretonnien | ||||
|  | ||||
| Mainteneur/Développeur : LeRatierBretonnien | ||||
| Développeur : VincentVk | ||||
| Tests, Compendiums, Données: Fred, Fab, Grendel, LeRatierBretonnien, VincentVk | ||||
| Styles/CSS : Mandar, VincentVk | ||||
| Tests, Compendiums, Données: Fred, Fab, Grendel | ||||
| Styles/CSS : Mandar | ||||
|  | ||||
| # Mentions Légales | ||||
|  | ||||
| @@ -23,6 +23,6 @@ La carte des Terres Médianes du Rêve est une illustration de **Jidus**, utilis | ||||
| Les silhouettes des créatures, humanoïdes et entités sont des illustrations de **Roland Barthélémy**, et sont utilisés dans le cadre de ce projet avec son aimable autorisation. | ||||
| Merci à eux !! | ||||
|  | ||||
| Toute la propriété intellectuelle leur appartient, ce système est une adaptation destinée à fonctionner sous FoundryVTT. | ||||
| Toute la propriété intellectuelle leur appartient, ce système est une adpatation destinée à fonctionner sous FoundryVTT. | ||||
|  | ||||
| L'ensemble du code est sous licence Creative Commons. | ||||
| @@ -1 +0,0 @@ | ||||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height: 256px; width: 256px;"><g class="" transform="translate(0,0)" style=""><path d="m214.02 19.115-.02.06a433.415 433.415 0 0 1 106.393 58.446L368.02 158.4C292.254 72.063 181.72 20.678 64.66 20.604c-14.96-.01-30.027.834-45.14 2.535v18.8c108.174-12.774 213.91 21.292 293.527 88.554l42.314 97.416C290.887 132.486 182.425 73.885 66.395 73.21a349.119 349.119 0 0 0-46.879 2.906v18.85c98.998-13.552 196.12 18.532 267.11 82.264l30.708 87.82c-53.922-85.58-148.482-138.656-249.986-139.69a297.451 297.451 0 0 0-47.83 3.398v18.914c93.33-15.18 185.38 18.05 247.677 83.27l20.694 83.917C246.555 230.42 160.67 176.716 67.7 175.423a248.202 248.202 0 0 0-48.182 4.06v19.036c89.513-17.794 178.655 19.16 230.357 89.468l4.62 73.348c-28.973-83.013-107.888-136.692-193.257-135.87a201.938 201.938 0 0 0-41.72 4.78v19.188c77.22-18.904 155.333 13.983 197.095 77.14l5.873 57.49c23.33-6.283 47.534-13.218 68.727-20.873 19.194-6.93 35.884-14.525 46.596-22.038 5.354-3.756 9.142-7.478 11.174-10.574 2.033-3.096 2.47-5.184 2.098-7.59l-1.252-8.123 137.074-39.556C446.897 159.92 363.67 69.964 260.654 19.114H214.02zm278.86 273.922-40.196 11.6c1.63 18.66-4.666 36.567-16.397 52.043-14.18 18.707-35.934 34.627-62.363 48.257-45.23 23.33-104.45 39.877-164.397 47.97l4.38 16.35c68.63-7.66 143.34-22.038 198.17-48.538 30.517-14.75 54.633-33.123 68.722-55.33 12.74-20.084 17.775-43.384 12.08-72.353zm-58.513 16.885-65.027 18.765c-.736 4.345-2.345 8.51-4.733 12.147-3.925 5.98-9.462 10.986-16.068 15.62-13.213 9.266-30.996 17.098-50.978 24.316-31.927 11.53-68.41 20.998-99.558 29.134l6.644 24.79c59.027-7.79 117.64-24.153 160.71-46.366 24.828-12.805 44.388-27.573 56.037-42.94 8.804-11.614 13.283-23.135 12.972-35.466zm-261.754 77.43-33.033 8.85 8.197 30.59c10.812 3.95 18.623 14.38 18.623 26.485 0 6.87-2.52 13.2-6.673 18.114l4.716 17.6 33.034-8.85-24.864-92.788zM138.22 443.79c-1.49 0-2.88.33-4.12.91l-75.6 20.255a30.49 30.49 0 0 1 4.625 16.14c0 .67-.03 1.33-.072 1.987l75.96-20.352c4.96-.386 8.698-4.37 8.698-9.453 0-5.35-4.138-9.488-9.49-9.488zM32.327 468.985c-6.798 0-12.11 5.312-12.11 12.11 0 6.798 5.312 12.11 12.11 12.11 6.798 0 12.111-5.312 12.111-12.11 0-6.798-5.313-12.11-12.11-12.11z" fill="#fff" fill-opacity="1"></path></g></svg> | ||||
| Before Width: | Height: | Size: 2.2 KiB | 
| @@ -1 +0,0 @@ | ||||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height: 256px; width: 256px;"><g class="" transform="translate(0,0)" style=""><path d="M119.1 25v.1c-25 3.2-47.1 32-47.1 68.8 0 20.4 7.1 38.4 17.5 50.9L99.7 157 84 159.9c-13.7 2.6-23.8 9.9-32.2 21.5-8.5 11.5-14.9 27.5-19.4 45.8-8.2 33.6-9.9 74.7-10.1 110.5h44l11.9 158.4h96.3L185 337.7h41.9c0-36.2-.3-77.8-7.8-111.7-4-18.5-10.2-34.4-18.7-45.9-8.6-11.4-19.2-18.7-34.5-21l-16-2.5L160 144c10-12.5 16.7-30.2 16.7-50.1 0-39.2-24.8-68.8-52.4-68.8-2.9 0-4.7-.1-5.2-.1zM440 33c-17.2 0-31 13.77-31 31s13.8 31 31 31 31-13.77 31-31-13.8-31-31-31zM311 55v48H208v18h103v158h-55v18h55v110H208v18h103v32h80.8c-.5-2.9-.8-5.9-.8-9 0-3.1.3-6.1.8-9H329V297h62.8c-.5-2.9-.8-5.9-.8-9 0-3.1.3-6.1.8-9H329V73h62.8c-.5-2.92-.8-5.93-.8-9 0-3.07.3-6.08.8-9H311zm129 202c-17.2 0-31 13.8-31 31s13.8 31 31 31 31-13.8 31-31-13.8-31-31-31zm0 160c-17.2 0-31 13.8-31 31s13.8 31 31 31 31-13.8 31-31-13.8-31-31-31z" fill="#fff" fill-opacity="1"></path></g></svg> | ||||
| Before Width: | Height: | Size: 996 B | 
| @@ -1 +0,0 @@ | ||||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height: 256px; width: 256px;"><g class="" transform="translate(0,0)" style=""><path d="M80 32c-64 256 48 416 176 464 128-48 240-208 176-464-112 32-240 32-352 0zm99.3 52.9c14.7 27.9 40.1 26.4 65 26.4l53.9 1.5 7.8 25 77.1 10.3 3.5 49.9c-27.9 7.4-83.7 5.9-83.8 17.7-.2 20.6 36.3 16.2 78.1 5.9L356.7 276l-61.4 4.4c3.8 46.4-1.2 77.6-35.6 110.7l-21.9-55.3c-12.6 22.6-30 38.8-57.3 41.4 10.6-26 19.1-46.7 9.7-76.3-13.5 13.3-35.1 18.7-64.8 16.7 31.6-49 48.3-101.9 62.1-151.9l-23.2-20.6c-6.6-23.5-1.3-44.1 15-60.2z" fill="#fff" fill-opacity="1"></path></g></svg> | ||||
| Before Width: | Height: | Size: 621 B | 
| @@ -1 +0,0 @@ | ||||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height: 256px; width: 256px;"><g class="" transform="translate(0,0)" style=""><path d="M261.563 64.28A191.758 191.758 0 0 0 64.25 256a191.758 191.758 0 1 0 383.5 0A191.758 191.758 0 0 0 261.562 64.28zm-4.625 9.126 8.937 5.156v10.313l-8.938 5.156-8.906-5.155V78.562l8.907-5.156zm3.53 29.25A153.407 153.407 0 0 1 409.407 256a153.407 153.407 0 0 1-306.812 0A153.407 153.407 0 0 1 260.47 102.656zm-11.53 20.03a133.607 133.607 0 0 0-65.157 20.908V368.22a133.607 133.607 0 0 0 65.157 21.092V122.688zm17.687.314v266.125a133.607 133.607 0 0 0 63.438-22.03V145a133.607 133.607 0 0 0-63.438-22zm-100.5 34.344A133.607 133.607 0 0 0 122.405 256a133.607 133.607 0 0 0 43.72 98.78V157.345zm-60.72 1.625 8.907 5.155v10.28l-8.906 5.157-8.937-5.156v-10.28l8.936-5.157zm300.5 0 8.94 5.155v10.28l-8.94 5.157-8.905-5.156v-10.28l8.906-5.157zm-58.155.093V353.03A133.607 133.607 0 0 0 389.594 256a133.607 133.607 0 0 0-41.844-96.938zm57.813 173.125 8.937 5.156v10.312l-8.938 5.156-8.906-5.156v-10.312l8.906-5.156zm-299.813.718 8.938 5.156v10.313l-8.938 5.156-8.938-5.155v-10.313l8.938-5.156zm149.906 85.188 8.938 5.156v10.313l-8.938 5.156-8.906-5.158v-10.31l8.906-5.156z" fill="#fff" fill-opacity="1"></path></g></svg> | ||||
| Before Width: | Height: | Size: 1.2 KiB | 
| @@ -1,66 +0,0 @@ | ||||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||||
| <svg | ||||
|    xmlns:dc="http://purl.org/dc/elements/1.1/" | ||||
|    xmlns:cc="http://creativecommons.org/ns#" | ||||
|    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||||
|    xmlns:svg="http://www.w3.org/2000/svg" | ||||
|    xmlns="http://www.w3.org/2000/svg" | ||||
|    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||||
|    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||||
|    viewBox="0 0 310.12469 310.12469" | ||||
|    version="1.1" | ||||
|    id="svg6" | ||||
|    sodipodi:docname="jeu.svg" | ||||
|    width="310.12469" | ||||
|    height="310.12469" | ||||
|    inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"> | ||||
|   <metadata | ||||
|      id="metadata12"> | ||||
|     <rdf:RDF> | ||||
|       <cc:Work | ||||
|          rdf:about=""> | ||||
|         <dc:format>image/svg+xml</dc:format> | ||||
|         <dc:type | ||||
|            rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | ||||
|         <dc:title></dc:title> | ||||
|       </cc:Work> | ||||
|     </rdf:RDF> | ||||
|   </metadata> | ||||
|   <defs | ||||
|      id="defs10" /> | ||||
|   <sodipodi:namedview | ||||
|      pagecolor="#ffffff" | ||||
|      bordercolor="#666666" | ||||
|      borderopacity="1" | ||||
|      objecttolerance="10" | ||||
|      gridtolerance="10" | ||||
|      guidetolerance="10" | ||||
|      inkscape:pageopacity="0" | ||||
|      inkscape:pageshadow="2" | ||||
|      inkscape:window-width="2532" | ||||
|      inkscape:window-height="1492" | ||||
|      id="namedview8" | ||||
|      showgrid="false" | ||||
|      fit-margin-top="0" | ||||
|      fit-margin-left="0" | ||||
|      fit-margin-right="0" | ||||
|      fit-margin-bottom="0" | ||||
|      inkscape:zoom="1.4355469" | ||||
|      inkscape:cx="155.06205" | ||||
|      inkscape:cy="142.25079" | ||||
|      inkscape:window-x="0" | ||||
|      inkscape:window-y="0" | ||||
|      inkscape:window-maximized="0" | ||||
|      inkscape:current-layer="svg6" /> | ||||
|   <g | ||||
|      class="" | ||||
|      transform="translate(-100.93795,-121.74921)" | ||||
|      id="g4"> | ||||
|     <path | ||||
|        d="m 477.518,181.966 a 25,25 0 0 1 -34.91,23 l -62.29,150.26 h -248.92 l -62.24,-150.19 a 25,25 0 1 1 9.73,-7.29 l 87,71.2 20.92,-126.4 a 25,25 0 1 1 14.7,-1.85 l 54.31,117 54.42,-117.3 a 25,25 0 1 1 14.58,2.08 l 20.93,126.42 87.26,-71.3 a 25,25 0 1 1 44.51,-15.63 z m -71.66,241.25 h -300 v 60 h 300 z m -27.75,-52 h -244.22 v 36 h 244.22 z" | ||||
|        fill="#ffffff" | ||||
|        fill-opacity="1" | ||||
|        transform="matrix(0.7,0,0,0.7,76.8,76.8)" | ||||
|        id="path2" /> | ||||
|   </g> | ||||
| </svg> | ||||
| Before Width: | Height: | Size: 2.1 KiB | 
| @@ -1,63 +0,0 @@ | ||||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||||
| <svg | ||||
|    xmlns:dc="http://purl.org/dc/elements/1.1/" | ||||
|    xmlns:cc="http://creativecommons.org/ns#" | ||||
|    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||||
|    xmlns:svg="http://www.w3.org/2000/svg" | ||||
|    xmlns="http://www.w3.org/2000/svg" | ||||
|    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||||
|    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||||
|    viewBox="0 0 512 512" | ||||
|    version="1.1" | ||||
|    id="svg8" | ||||
|    sodipodi:docname="meditation1.svg" | ||||
|    width="512" | ||||
|    height="512" | ||||
|    inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"> | ||||
|   <metadata | ||||
|      id="metadata14"> | ||||
|     <rdf:RDF> | ||||
|       <cc:Work | ||||
|          rdf:about=""> | ||||
|         <dc:format>image/svg+xml</dc:format> | ||||
|         <dc:type | ||||
|            rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | ||||
|         <dc:title></dc:title> | ||||
|       </cc:Work> | ||||
|     </rdf:RDF> | ||||
|   </metadata> | ||||
|   <defs | ||||
|      id="defs12" /> | ||||
|   <sodipodi:namedview | ||||
|      pagecolor="#ffffff" | ||||
|      bordercolor="#666666" | ||||
|      borderopacity="1" | ||||
|      objecttolerance="10" | ||||
|      gridtolerance="10" | ||||
|      guidetolerance="10" | ||||
|      inkscape:pageopacity="1" | ||||
|      inkscape:pageshadow="2" | ||||
|      inkscape:window-width="3840" | ||||
|      inkscape:window-height="2054" | ||||
|      id="namedview10" | ||||
|      showgrid="true" | ||||
|      fit-margin-top="0" | ||||
|      fit-margin-left="0" | ||||
|      fit-margin-right="0" | ||||
|      fit-margin-bottom="0" | ||||
|      inkscape:zoom="1.4355469" | ||||
|      inkscape:cx="254.56378" | ||||
|      inkscape:cy="255.99978" | ||||
|      inkscape:window-x="-11" | ||||
|      inkscape:window-y="-11" | ||||
|      inkscape:window-maximized="1" | ||||
|      inkscape:current-layer="svg8"> | ||||
|     <inkscape:grid | ||||
|        type="xygrid" | ||||
|        id="grid856" /> | ||||
|   </sodipodi:namedview> | ||||
|   <path | ||||
|      id="polygon2" | ||||
|      style="fill:#ffffff;fill-opacity:1;stroke:none" | ||||
|      d="M 256,0 0,256 256,512 512,256 Z m 5.11719,62.361328 c 8.239,0 15.89463,4.297288 21.83203,12.054688 5.2108,6.811 8.83798,16.231192 9.64648,26.841794 -8.4868,-3.970403 -17.26742,-6.37191 -26.14062,-7.13281 v 12.81836 c 8.5484,0.9429 17.03537,3.85822 25.48437,8.64062 -1.442,8.41469 -4.67333,15.84043 -8.99023,21.48243 -5.9367,7.7574 -13.59443,12.05468 -21.83203,12.05468 -8.2376,0 -15.8726,-4.29728 -21.8086,-12.05468 -4.452,-5.8184 -7.76497,-13.52864 -9.14257,-22.26953 7.8043,-4.21541 15.53348,-6.75681 23.20898,-7.72071 V 94.191406 c -7.938,0.763 -15.87192,2.852576 -23.66992,6.300784 0.9261,-10.297007 4.51857,-19.430374 9.60547,-26.076174 5.936,-7.7581 13.57099,-12.052735 21.80859,-12.052735 z M 228.50391,144.4375 c 0.14,0.1883 0.27391,0.38286 0.41601,0.56836 7.8876,10.3082 19.34232,17.19336 32.19922,17.19336 12.8569,0 24.31162,-6.88586 32.19922,-17.19336 0.1421,-0.1862 0.27797,-0.37936 0.41797,-0.56836 7.2765,3.3453 12.81763,7.79108 15.76953,12.86328 h 0.0449 l 29.11524,45.10547 35.48046,-15.37891 c 20.5632,-11.2833 43.10446,16.80074 21.43946,29.18164 l -66.12891,30.84571 -25.74609,-33.90821 c -11.6662,23.2505 -11.80448,46.48779 6.66992,69.73829 37.3275,-3.0275 65.31156,3.90026 69.47656,19.44726 3.4104,12.7316 -9.91357,28.42679 -33.35937,42.45899 l -66.10743,-21.9629 33.66602,-11.17773 -4.11328,-12.4043 -50.29102,16.69141 -50.26757,-16.69141 -4.11133,12.4043 126.1289,41.89063 15.53321,37.60351 -64.44532,-20.10351 0.0234,-0.22071 c -0.2989,-0.0168 -0.5782,-0.0463 -0.875,-0.0645 l -0.30664,-0.0879 h -1.09375 c -43.1116,-2.7132 -70.90445,-9.13273 -109.87695,-29.64063 -19.6938,-13.027 -30.49667,-27.09126 -27.38867,-38.69726 h -0.0215 c 3.4755,-12.9682 23.51598,-19.95189 51.73438,-20.14649 5.3179,-0.0364 10.93654,0.18537 16.77734,0.63477 19.418,-23.6082 20.76969,-47.21649 7.67969,-70.80859 l -26.6211,35.04296 -66.1289,-30.84375 c -21.665,-12.3816 0.87304,-40.46424 21.43554,-29.18164 l 35.46094,15.37891 29.13672,-45.10547 0.26172,0.0664 c 2.9421,-5.1016 8.50701,-9.56969 15.81641,-12.92969 z m -44.58008,217.70117 c 12.7582,5.6602 24.87218,9.90172 37.20898,13.10352 l -48.91406,15.24609 z" /> | ||||
| </svg> | ||||
| Before Width: | Height: | Size: 3.8 KiB | 
| @@ -1 +0,0 @@ | ||||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height: 256px; width: 256px;"><g class="" transform="translate(2,-1)" style=""><path d="m375.2 23.61-12.7 12.7 24.5 24.5c.5-1.2 1-2.3 1.5-3.5 2.4-6.6 4.1-12.4 4.9-15.5zm33.3 30.5c-.9 3-1.9 5.9-3.3 9.6-4 10.8-9.1 23.4-20.2 30.4-4 2.4-8.1 2.6-11.2 2.3-3.1-.3-5.6-1.1-7.5-1.6-1.7-.4-2.6-.6-3.2-.7-.6.9-1.2 2.2-1.6 4.5-.8 3.19-1 7.49-.8 11.59.1 6 .7 10.5 1.2 13.1l26.8 26.8c2.6.4 7.1 1 13 1.2 7.5.1 14.3-1.8 16-2.7-.1-.8-.2-1.4-.6-2.9-.5-2-1.3-4.5-1.7-7.6-.3-3.1 0-7.3 2.3-11.2 7-11.1 19.6-16.2 30.5-20.3 3.6-1.4 6.6-2.2 9.6-3.1l-16.4-32.89zm-67.2 3.4-12.7 12.7 17.4 17.5c1.3-2.9 3-5.6 5.6-7.9 2.5-2.2 5.6-3.3 8.3-3.7zm128.9 60.99c-3.2.8-9.1 2.4-15.7 5-1.1.4-2.2.8-3.4 1.3l24.6 24.6 12.7-12.7zm-120.7 17.9L217.4 262.3l9.8 9.8 129-129zm86.3 15.5c-.4 2.8-1.5 6-3.8 8.5s-4.8 4.3-7.5 5.6l17.3 17.3 12.7-12.7zm-66.9 3.9L240 284.9l9.7 9.6 125.9-132zm-226.3 94.5c-30.4 0-60.87 11.6-84.13 34.9-46.53 46.5-46.53 121.7 0 168.3C105 500 180.2 500 226.8 453.5c35.8-35.9 43.9-88.5 24.7-132.2L156.8 416l14.9 14.9-12.8 12.7-90.46-90.5 12.73-12.7 14.75 14.7 94.78-94.7c-15.3-6.8-31.7-10.1-48.1-10.1zm60.6 23.2-94.5 94.4 11.3 11.3 94.5-94.4zm24 24L132.7 392l11.2 11.2 94.6-94.4z" fill="#fff" fill-opacity="1"></path></g></svg> | ||||
| Before Width: | Height: | Size: 1.2 KiB | 
| @@ -1,65 +0,0 @@ | ||||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||||
| <svg | ||||
|    xmlns:dc="http://purl.org/dc/elements/1.1/" | ||||
|    xmlns:cc="http://creativecommons.org/ns#" | ||||
|    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||||
|    xmlns:svg="http://www.w3.org/2000/svg" | ||||
|    xmlns="http://www.w3.org/2000/svg" | ||||
|    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||||
|    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||||
|    width="66.69709mm" | ||||
|    height="66.69709mm" | ||||
|    viewBox="0 0 378.10574 378.10571" | ||||
|    version="1.1" | ||||
|    id="svg3" | ||||
|    sodipodi:docname="sort.svg" | ||||
|    inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"> | ||||
|   <metadata | ||||
|      id="metadata9"> | ||||
|     <rdf:RDF> | ||||
|       <cc:Work | ||||
|          rdf:about=""> | ||||
|         <dc:format>image/svg+xml</dc:format> | ||||
|         <dc:type | ||||
|            rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | ||||
|         <dc:title></dc:title> | ||||
|       </cc:Work> | ||||
|     </rdf:RDF> | ||||
|   </metadata> | ||||
|   <defs | ||||
|      id="defs7" /> | ||||
|   <sodipodi:namedview | ||||
|      pagecolor="#ffffff" | ||||
|      bordercolor="#666666" | ||||
|      borderopacity="1" | ||||
|      objecttolerance="10" | ||||
|      gridtolerance="10" | ||||
|      guidetolerance="10" | ||||
|      inkscape:pageopacity="0" | ||||
|      inkscape:pageshadow="2" | ||||
|      inkscape:window-width="3840" | ||||
|      inkscape:window-height="2054" | ||||
|      id="namedview5" | ||||
|      showgrid="false" | ||||
|      inkscape:zoom="3.887601" | ||||
|      inkscape:cx="72.254869" | ||||
|      inkscape:cy="97.300114" | ||||
|      inkscape:window-x="-11" | ||||
|      inkscape:window-y="-11" | ||||
|      inkscape:window-maximized="1" | ||||
|      inkscape:current-layer="svg3" | ||||
|      inkscape:document-rotation="0" | ||||
|      inkscape:snap-text-baseline="true" | ||||
|      fit-margin-top="0" | ||||
|      fit-margin-left="0" | ||||
|      fit-margin-right="0" | ||||
|      fit-margin-bottom="0" /> | ||||
|   <path | ||||
|      id="Sélection #2" | ||||
|      fill="none" | ||||
|      stroke="black" | ||||
|      stroke-width="1" | ||||
|      d="M 189.05286,0 378.10571,189.05286 189.05285,378.10571 0,189.05286 Z m 98.94184,241.93328 c -0.88,-10.41 -2.89,-10.17 -9.87,-16.75 l -5.39,-5.72 c -2.61,-2.12 -6.9,-3.02 -8.72,-5.91 -1.19,-1.9 -0.91,-4.46 -1.28,-6.62 -3.40308,-4.90559 -2.01923,-20.20245 -2.01923,-26.63889 3.88586,-9.60746 4.36923,-1.69111 7.45923,-14.36111 0.62,-2.55 2.32,-6.14 1.21,-8.69 -1.07,-2.43 -3.44,-2.03 -6.71,-5.17 -5.66937,-7.30653 -11.39498,-14.88252 -18.68,-20.92 -23.49144,-15.67176 -34.12005,-20.68725 -60,-20.32 -8.54383,0.23148 -13.2432,0.66798 -20,2.68 -19.05,6.09 -27.58,11.85 -41.76999,25.79 -8.08,7.96 -7.17,10.3 -10.91,14.41 -3.1,3.4 -6.12,3.44 -6.73,7.27 -0.64,1.83 -0.09,3.98 0,5.78 1.91418,8.65633 2.50026,3.00305 7.73101,9.8295 1.38405,9.6854 0.3222,25.26042 -0.70608,33.05113 -2.53556,2.89228 -2.29493,5.91937 -3.63493,7.97937 -1.62,2.49 -4.35,2.16 -7.77,5.03 -5.170004,4.32 -4.470004,8.06 -13.210004,13.28 1.78,5.5 4.63,5.91 10,6 z M 195.6316,118.20709 c 11.22808,5.82176 1.31866,21.02928 -11.27386,31.1911 13.0336,5.31132 -0.79998,6.64062 23.09132,6.48796 l 32.86359,-0.54563 13.5005,1.22254 7.27084,3.68304 c -4.13,5.49 -2.71929,1.23718 -2.08929,8.68718 h -4 c -0.28,-1.68 -0.54282,-4.85331 -1.87282,-6.17331 -3.32127,-0.17387 -9.61514,-0.5831 -13.55025,0.47743 -0.17052,3.22972 -0.29693,4.01588 -0.57693,5.69588 l -3.40923,-0.34102 c -0.28,-1.68 0.27564,-3.83025 -1.05436,-5.15025 -3.7305,-0.17387 -10.29718,-0.7195 -13.48204,0.40923 -1.33,1.32 -0.77437,3.40204 -1.05437,5.08204 h -3 c -0.28,-1.68 0.071,-3.08 -0.91796,-5.08204 -2.83922,-1.53335 -14.39204,-0.93796 -18.08204,-0.91796 -1.96,0.01 -5.02,-0.11 -6.68,1.02 -0.19823,6.27508 -0.4088,8.38327 1.52129,9.86916 l 20.15871,0.0399 v 37.07089 h -19.09 c 0.0887,-5.45486 2.17,-22.09 0,-25.77 -2.24,-3.53 -10.37,-4.58 -13.31,-1.63 -0.59765,14.41964 -0.37159,20.85123 -0.92619,27.34486 -16.5374,0 -13.4074,0.42 -16.5374,0 l -0.13641,-21.94486 c -0.0284,-4.56991 -0.5617,-9.93269 1.12488,-14.46674 3.57532,-2.18241 14.40143,0.2341 20.38143,-0.7259 1.06669,-3.31458 1.12908,-6.5781 0.80651,-10.05451 -2.74793,-0.83105 -4.76282,-0.70285 -7.31282,-0.75285 h -11 c -7.39,0.05 -9.43418,2.79797 -7.61418,10.68797 l -6.48228,0.24114 c 0.72,-2.06 1.97646,-7.02474 0.81646,-9.16474 -1.7,-3.14 -11.93127,-2.75719 -14.21127,-0.43719 -2.03,2.07 -1.8049,7.64421 -1.24493,10.08421 l -7.37013,0.12387 c -0.24405,12.94493 0.23633,18.13752 0.10633,29.28752 -0.09,7.42 0.28,6.88722 -7.99999,7.17722 v -28 c 0,-2.48 0.22,-6.59 -1.17,-8.69 -1.62,-2.42 -4.26,-2.22 -6.83,-2.31 2.73,-7.8 6.25917,-8.9 -1.27083,-9 10.53404,-8.39725 16.12632,-16.70355 22.85717,-22.49183 5.05278,-4.9362 12.06169,-10.2231 15.11169,-11.61765 14.97984,-6.56268 20.63207,-10.69702 43.93886,-10.61671 z m -73.26379,44.49619 c -0.79548,4.04536 -1.9331,12.40663 2.6469,12.48663 10.50353,0.43469 11.50999,-8.2279 8.90999,-11.7879 -1.43,-1.96 -9.22689,-0.64873 -11.55689,-0.69873 z m 19.62689,11.59316 9.01278,-0.14468 0.91722,5.78152 c 0.10638,11.6222 0,0 0.0146,31.52202 -8.59422,-0.32911 -7.4946,-0.52202 -9.9446,-0.52202 z m 80.95177,-0.77164 8.14469,0.22835 -0.0965,36.18013 h -8 z m 19.38582,0.5305 7.6014,-0.33759 0.061,36.21557 h -8 z m -129.12528,49.01235 11.33333,-0.31493 45.72718,-0.54563 59.09028,-0.81845 33.54662,-0.27282 c 7.10809,1.39089 4.61048,5.28283 13.46463,11.36941 -49.05198,-0.38776 -122.72138,-0.48241 -173.42548,-0.8649 z" | ||||
|      style="fill:#d6d2d0;fill-opacity:1;stroke:none" | ||||
|      sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccccccccccccccccscccccccccccccsccccccccccccccccccccccccccccccccccc" /> | ||||
| </svg> | ||||
| Before Width: | Height: | Size: 5.2 KiB | 
| @@ -1 +0,0 @@ | ||||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height: 256px; width: 256px;"><g class="" transform="translate(0,-28)" style=""><path d="M355.102 21.097c-33.682.164-64.173 18.585-74.615 50.5 21.357-.79 23.203 53.922 23.203 53.922l41.619 6.262c-13.41 12.963-50.025 5.967-50.025 5.967-17.14 19.182-33.124 40.966-47.758 57.578-15.952 18.127-35.2 38.103-57.018 60.086-6.79 6.823 41.594-9.821 34.342-2.604-24.567 12.751-42.297 16.097-61.764 32.069-31.312 25.674-62.853 60.71-81.146 79.431-7.711 7.91-44.362 37.674 20.469 34.74 2.404 7.52-1.621 9.456-7.493 15.293-4.327 4.303-18.082.283-22.263 2.828-22.172 35.055-17.246 37.975-27.43 58.047-4.252 11.635 41.68-14.404 64.305-34.18 13.974-7.58 25.147-21.652 35.002-17.202 43.11 18.984 129.826 35.53 141.328 27.619 18.368-12.646-10.321-46.343 3.832-97.912 23.47 5.817 43.825 13.657 66.767 11.459-1.581 49.307 3.56 55.306-3.888 104.777l59.129 21.127 1.91-13.809-33.815-22.478c14.568-50.659 16.809-72.578 15.227-121.719-.16-5.372-45.168-24.325-74.492-33.133l18.593-30.412c30.393-44.788 124.141-62.055 127.932-88.258-13.02-19.676 3.022-27.384-25.092-21.912-6.295 1.318-13.771 24.346-18.023 27.213-7.843 5.276-40.655 24.477-51.951 18.377-1.9-1.026 7.246-33.441 6.85-44.78-.116-3.205-1.19-6.625-2.866-10.001.185-.64 15.24-52.482 54.809-94.016-43.978 25.134-65.332 79.925-65.354 79.98-2.207-2.134-4.476-3.983-6.639-5.423-1.916-14.7-4.819-73.02 68.598-78.776-21.427-21.177-47.704-30.78-72.283-30.66z" fill="#fff" fill-opacity="1" transform="translate(76.8, 76.8) scale(0.7, 0.7) rotate(0, 256, 256) skewX(0) skewY(0)"></path></g></svg> | ||||
| Before Width: | Height: | Size: 1.6 KiB | 
| @@ -1 +0,0 @@ | ||||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height: 256px; width: 256px;"><g class="" transform="translate(0,-28)" style=""><path d="M332.031 66.13c-28.807-.01-55.439 14.149-67.88 40.65 20.79 1.744 16 55.07 16 55.07-11.814 16.687-24.73 33.186-36.589 50.146 0 0-99.046 132.283-178.378 168.025-28.049 22.593-33.305 36.532-44.137 52.649-4.877 9.54 9.257 14.324 11.701 13.2 22.726-10.461 25.176-20.866 47.07-35.675 12.805-5.026 23.839-15.9 31.854-11.049 34.962 20.86 107.556 44.28 118.271 38.706 17.857-9.263-5.78-43.585 16.174-89.057 31.97-3.352 58.916-.885 88.332-12.094 3.483 50.279 10.106 54.59 6.766 107.092l71.2 1.045.698-14.61-41.814-11.105c11.528-56.054 11.816-78.996 4.672-127.996-.956-6.622-53.746-8.275-81.012-3.79 24.449-24.202 40.274-45.24 47.506-68.44l.027.189c7.637 15.923 30.083 33.958 35.336 37.125 27.704 11.048 38.214 7.982 62.955 3.887 4.907-.784 27.47 24.537 44.807 9.597 2.642-20.238 16.522-20.369-4.938-32.71-4.847-2.73-27.063 7.462-31.418 6.898-20.21-2.481-30.954-5.211-58.45-12.703-10.23-13.187-32.676-56.136-55.43-59.744 6.535-14.15 28.226-53.108 73.664-66.237-20.943-26.54-49.925-39.057-76.987-39.068zm82.405 46.722c-46.658 19.516-58.266 50.4-58.266 50.4l9.916 7.644s9.646-4.765 48.35-58.044zm23.04 160.005-4.658 11.418c5.233-.083 10.425.47 15.328 1.608-12.774 30.856-23.938 59.635-28.181 93.094l-.908 7.558 4.863-5.889c20.805-25.671 32.303-55.25 44.95-85.78 4.203 2.656 8.24 5.885 12.071 9.35l4.78-11.374-20.518-8.526-31.767 66.579 24.062-69.713-20.021-8.325z" fill="#fff" fill-opacity="1" transform="translate(76.8, 76.8) scale(0.7, 0.7) rotate(0, 256, 256) skewX(0) skewY(0)"></path></g></svg> | ||||
| Before Width: | Height: | Size: 1.6 KiB | 
| @@ -1 +0,0 @@ | ||||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height: 256px; width: 256px;"><g class="" transform="translate(0,0)" style=""><path d="M56.813 18.438c-.47-.005-.938.014-1.407.03-.625.023-1.252.066-1.875.126-7.468.72-14.682 4.148-22.31 11.125-9.985 9.128-12.863 17.66-11.407 27.718 1.455 10.056 8.353 22.236 21.125 34.906 2.895 2.872 6.126 5.737 9.593 8.625 1.27 1.055 2.565 2.13 3.907 3.186a200.62 200.62 0 0 0 3.438 2.656c.232.175.454.358.688.532C74.71 119.38 95.558 131.28 120.25 142.22c159.723 161.31 288.815 297.553 374.594 352.124-51.11-85.624-187.432-214.62-350-375.531-10.23-23.802-21.115-43.71-32.094-59.282 35.46-10.19 82.517-2.294 125.75 40.94 40.243 40.242 52.642 90.776 41.375 128.343 4.89 4.914 9.883 9.913 14.688 14.75 19.07-46.1 4.573-108.895-42.844-156.313-35.694-35.693-75.48-50.324-111.032-50.22-1.147.005-2.3.03-3.438.064-21.844.65-41.957 6.898-58.344 17.187a102.302 102.302 0 0 0-8.312 5.814c1.33 3.094 2.758 5.884 4.406 8.218 1.92 2.72 4.004 4.936 6.906 6.688 2.202-1.717 4.498-3.375 6.938-4.906a88.727 88.727 0 0 1 3.25-1.97c8.196 10.088 15.465 24.624 25.47 47.25-23.907-10.568-38.822-18.04-49.033-27 .024-.03.04-.063.064-.093-.433-.33-.867-.655-1.28-1-.013-.008-.022-.02-.033-.03-11.215-10.375-16.532-22.934-22.31-44.5 5.988 1.605 11.256 3.19 16 4.844a137.13 137.13 0 0 1 26.81-15.875c-9.5-7.738-18.552-11.93-26.686-12.97-1.443-.185-2.87-.3-4.282-.313zM493.28 64.374c-77.985 0-125.587 28.886-146.124 69.406-20.536 40.52-13.994 90.39 9.688 131.407 11.385 19.72 17.807 40.687 19.187 61.22a4329.64 4329.64 0 0 1 18.47 19.187c2.31-29.955-5.072-61.35-21.47-89.75-21.13-36.602-26.155-80.112-9.186-113.594 16.97-33.481 55.94-59.188 129.437-59.188V64.376zM37.907 114.938c-2.894 23.925 6.18 50.21 29.532 73.562l13.218-13.188c-15.97-15.97-23.188-31.833-24.437-46.593-6.646-4.51-12.754-9.102-18.314-13.782zM124.062 277c-24.466-.028-45.04 4.92-61.343 13.656-24.842 13.31-39.363 35.865-40.75 60.47-2.78 49.207 44.38 102.65 140.405 118.28 101.63 16.544 170.303-9.184 205.406-54.062 1.01-1.29 1.988-2.59 2.94-3.906-4.552-4.232-9.148-8.52-13.783-12.875-1.233 1.79-2.52 3.55-3.875 5.28-29.97 38.315-90.355 62.97-187.687 47.126-90.394-14.715-126.796-62.527-124.75-98.783 1.023-18.127 10.982-34.37 30.938-45.062 19.955-10.692 50.267-15.364 90.5-7.47 34.077 6.69 62.938 3.47 85.437-6.936-4.72-4.65-9.49-9.33-14.28-14.064-17.545 6.452-39.89 8.088-67.564 2.656-14.895-2.923-28.778-4.297-41.594-4.312z" fill="#fff" fill-opacity="1"></path></g></svg> | ||||
| Before Width: | Height: | Size: 2.4 KiB | 
| @@ -1 +0,0 @@ | ||||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height: 256px; width: 256px;"><defs><filter id="shadow-1" height="300%" width="300%" x="-100%" y="-100%"><feFlood flood-color="rgba(201, 201, 201, 1)" result="flood"></feFlood><feComposite in="flood" in2="SourceGraphic" operator="atop" result="composite"></feComposite>0<feOffset dx="230" dy="300" result="offset"></feOffset><feComposite in="SourceGraphic" in2="offset" operator="over"></feComposite></filter></defs><g class="" transform="translate(-100,0)" style=""><path d="m375.483 251.243-109.98 51.138.213 183.381L477.01 266.346l-86.993-21.81zm-12.736 108.626-5.947 14.699-48.604-8.955 5.007-12.832a141.306 141.306 0 0 0 13.51-11.358 167.184 167.184 0 0 0 16.566-17.517 170.478 170.478 0 0 0 12.606-17.958 115.607 115.607 0 0 0 9.514-17.97l14.068 2.51q-9.37 22.334-30.361 44.43-13.296 13.64-20.645 18.636zM121.603 244.334l-84.71 21.763L246.474 486V302.38l-109.946-51.137zm19.147 50.852a28.72 28.72 0 0 1 24.273 6.802 53.052 53.052 0 0 1 11.226 14.188l-13.081 2.676a28.542 28.542 0 0 0-5.388-7.374q-5.185-4.876-11.262-3.853l-.487.095a6.458 6.458 0 0 0-5.162 4.448c-.856 2.378-.238 5.554 1.796 9.371q4.08 7.6 10.81 9.027a23.785 23.785 0 0 0 8.563-.203l1.867-.344 5.791 10.822q-6.398 1.427-8.23 3.282-3.21 3.14.429 9.93a17.042 17.042 0 0 0 6.089 6.696 10.406 10.406 0 0 0 7.385 1.534l.416-.083q4.757-.964 5.079-4.757c.261-2.57-.655-5.744-2.748-9.514l12.38-2.545a49.247 49.247 0 0 1 4.103 11.226 19.956 19.956 0 0 1-.642 9.383 11.702 11.702 0 0 1-3.96 5.411 19.575 19.575 0 0 1-8.027 3.235l-1.19.214a27.971 27.971 0 0 1-17.494-2.7 32.193 32.193 0 0 1-14.128-14.092q-3.627-6.79-2.604-12.19a8.396 8.396 0 0 1 2.521-4.947h-.071q-1.844.31-7.04-2.497a32.11 32.11 0 0 1-12.916-13.593q-5.245-9.764-3.282-18.398 1.962-8.634 13.676-11zM27.19 248.865l108.78-116.309a7.135 7.135 0 0 1 1.427 0h.154q3.14.345 2.842 3.71a19.36 19.36 0 0 1-3.294 8.1 39.376 39.376 0 0 1-9.728 10.405q-3.912 2.938-15.044 9.514-12.796 7.505-19.55 14.77a92.535 92.535 0 0 0-11.513 14.486l32.907 3.758 8.182-12.963-20.967-2.378a36.415 36.415 0 0 1 4.757-3.83q2.379-1.605 8.444-5.125l6.422-3.747a92.975 92.975 0 0 0 12.903-8.776 61.472 61.472 0 0 0 12.51-14.414q6.84-10.846 6.494-17.957c-.19-3.949-2.105-6.434-5.684-7.505l79.798-85.161-102.097 179.576-5.708 10.06zm367.238-71.974q-3.817-5.458-3.758-8.515c0-2.033 1.19-3.199 3.568-3.448h.57a11.892 11.892 0 0 1 6.91 2.247 29.85 29.85 0 0 1 7.837 8.051q3.687 5.28 3.71 8.397c0 2.093-1.188 3.258-3.496 3.567h-.594a11.75 11.75 0 0 1-6.957-2.378 29.79 29.79 0 0 1-7.79-7.885zm-109.41-141.52 83.948 89.634h-1.189c-.38 0-.975 0-1.463.107q-7.825.892-8.324 6.862-.5 5.97 5.03 13.747a53.778 53.778 0 0 0 6.375 7.374 37.901 37.901 0 0 0 10.144 6.897q-2.117 2.89-.702 7.98a37.283 37.283 0 0 0 5.613 11.096 55.122 55.122 0 0 0 15.223 14.806q8.098 5.268 16.066 4.935.81 0 1.618-.13 8.776-.988 9.228-7.873a16.114 16.114 0 0 0-.463-4.853l58.689 62.686-91.572-22.941-6.1-10.703zm98.22 104.927 2.45 2.617c.451.57.903 1.189 1.355 1.784 1.808 2.592 2.723 4.757 2.723 6.529 0 1.771-1.034 2.782-3.127 3.02h-.512a10.346 10.346 0 0 1-6.077-1.95 22.596 22.596 0 0 1-6.184-6.137c-1.974-2.83-2.937-5.102-2.878-6.814.06-1.713 1.118-2.7 3.187-2.937h.524a10.263 10.263 0 0 1 6.005 1.879 19.147 19.147 0 0 1 2.533 2.01zM255.987 26 137.456 231.026l118.532 55.05 118.604-55.05zm-1.19 208.463q-17.529 0-24.58-12.273-7.053-12.273-7.053-34.988 0-22.714 7.052-35.047 7.052-12.332 24.582-12.344 17.53 0 24.582 12.332 7.052 12.333 7.052 35.047 0 22.715-7.052 34.988-7.053 12.273-24.582 12.285zm10.538-71.807q2.497 7.968 2.497 24.546 0 15.817-2.497 24.201-2.498 8.384-10.537 8.325-8.04 0-10.632-8.325-2.593-8.324-2.593-24.2 0-16.579 2.593-24.547t10.632-7.968q8.015-.012 10.513 7.956z" fill="#fff" fill-opacity="1" filter="url(#shadow-1)" transform="translate(128, 128) scale(0.5, 0.5) rotate(-30, 256, 256) skewX(0) skewY(0)"></path></g></svg> | ||||
| Before Width: | Height: | Size: 3.8 KiB | 
| @@ -1 +0,0 @@ | ||||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height: 256px; width: 256px;"><g class="" transform="translate(0,-28)" style=""><path d="M119.436 36c-16.126 0-29.2 17.237-29.2 38.5v363c0 21.263 13.074 38.5 29.2 38.5h275.298c16.126 0 29.198-17.237 29.198-38.5v-363c0-21.263-13.072-38.5-29.198-38.5zm26.369 10.951 11.002 32.856 34.648.312-27.848 20.617 10.41 33.05-28.212-20.114-28.215 20.113L128 100.736 100.152 80.12l34.649-.312zM363.979 161.84c7.127 9.459 12.739 20.689 16.832 32.04 3.8 10.544 6.197 21.211 6.668 31.02-.163 19.015-3.915 23.274-14.557 36.934l-6.703-11.48c-10.85-13.106-30.779-48.4-47.383-43.672-6.521 6.11-8.996 13.37-10.313 20.802 2.898 8.8 4.477 18.43 4.477 28.516 0 15.293-3.615 29.54-9.996 41.416 22.643 4.537 57.927 19.332 57.973 39.223-.27 3.783-1.835 7.68-4.362 10.42-10.743 12.528-36.958 4.125-45.2 10.072.796 6.947 4.112 14.118 4.355 20.174.136 4.36-1.768 10.58-6.508 13.996-5.67 4.087-12.968 4.551-18.52 3.045C279.94 392.226 272 379.649 256 377c-13.544 3.491-22.412 13.87-34.742 17.346-5.552 1.506-12.85 1.042-18.52-3.045-4.74-3.417-6.644-9.636-6.508-13.996-.058-7.142 4.107-13.794 4.356-20.174-15.741-7.788-33.816 1.97-45.201-10.072-2.527-2.74-4.093-6.637-4.362-10.42 6.146-27.341 35.374-34.684 57.973-39.223C202.615 285.54 199 271.293 199 256c0-11.489 2.047-22.385 5.764-32.135-2.357-7.923-3.441-15.988-9.438-22.441-8.758-.925-14.079 6.897-17.842 12.63-11.683 19.5-18.718 30.606-32.88 46.192-16.604-23.4-19.314-49.29-13.157-70.988 6.065-20.331 19.17-38.798 37.926-47.924 21.216-9.766 39.872-10.03 58.885.203 5.163-13.053 10.4-25.65 18.035-36.209 9.625-13.31 23.8-25.631 43.707-25.295 38.8.656 73.993 51.156 73.979 81.807zm-72.22-63.893c-35.759 2.409-44.771 44.746-55.189 71.29l-9.447-7.087c-18.428-12.31-31.076-13.732-49.875-4.63-12.924 6.288-23.701 20.62-28.553 36.882-3.38 11.329-3.765 23.225-.949 33.645 9.45-13.549 15.806-30.08 28.317-39.178 7.486-7.975 26.27-8.498 35.45 3.897 4.838 7.02 7.437 14.54 9.5 22.234h72.165c.592-1.944 1.067-3.762 2.017-6.033 2.956-7.064 7.765-16.266 18.395-19.504 18.09-3.862 32.494 7.106 43.498 18.514 4.517 4.717 8.492 9.696 12.098 14.517-.69-6.798-2.477-14.651-5.31-22.508-13.127-36.707-37.889-51.031-70.386-32.011 2.556-16.423 16.87-35.72 46.25-26.962-9.094-17.135-30.355-42.471-47.98-43.066zM220.644 233c-2.31 6.965-3.643 14.753-3.643 23 0 15.85 4.892 30.032 12.26 39.855C236.628 305.68 245.988 311 256 311s19.372-5.32 26.74-15.145C290.108 286.032 295 271.85 295 256c0-8.247-1.334-16.035-3.643-23zM232 280h48s-8 14-24 14-24-14-24-14zm-11.14 33.566c-13.86 3.34-50.369 8.9-51.842 21.42 9.621 1.947 20.446.838 28.998 2.235 5.993 1.018 12.82 3.323 17.285 9.517 3.375 4.683 3.577 10.103 3.037 14.21-.543 5.89-3.317 10.557-3.975 16.32 15.955-2.59 28.264-17.532 41.637-18.268 16-.702 29.313 17.402 41.637 18.268-.893-5.59-3.262-11.158-3.975-16.32-.54-4.107-.338-9.527 3.037-14.21 4.465-6.194 11.292-8.5 17.285-9.517 9.742-2.229 19.975.396 28.998-2.235-5.77-13.125-39.813-19.454-51.841-21.42C281.665 323.01 269.45 329 256 329c-13.452 0-25.665-5.991-35.14-15.434zm117.122 64.649 28.213 20.113 28.215-20.113L384 411.264l27.848 20.617-34.649.312-11.004 32.856-11.002-32.856-34.648-.312 27.848-20.617z" fill="#fff" fill-opacity="1" transform="translate(76.8, 76.8) scale(0.7, 0.7) rotate(0, 256, 256) skewX(0) skewY(0)"></path></g></svg> | ||||
| Before Width: | Height: | Size: 3.2 KiB | 
| @@ -1 +0,0 @@ | ||||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height: 256px; width: 256px;"><g class="" transform="translate(0,-28)" style=""><path d="M211.313 21.094c-51.776 0-98.754 12.252-133.5 32.718C43.066 74.28 19.874 103.78 19.874 137.69c0 33.54 22.692 62.81 56.813 83.25L48.156 327.094l96.97-79.844c20.65 4.58 42.924 7.063 66.186 7.063 51.776 0 98.786-12.252 133.532-32.72 34.746-20.466 57.937-49.997 57.937-83.905s-23.19-63.41-57.936-83.875c-34.746-20.467-81.756-32.72-133.53-32.72zm0 18.687c48.8 0 92.866 11.77 124.03 30.126 31.165 18.357 48.75 42.447 48.75 67.78 0 25.338-17.585 49.457-48.75 67.814-31.164 18.357-75.23 30.125-124.03 30.125S118.445 223.857 87.28 205.5c-31.163-18.357-48.718-42.476-48.718-67.813 0-25.336 17.555-49.424 48.72-67.78C118.445 51.55 162.51 39.78 211.31 39.78zM96.53 89.938v18.688h93.126V89.937H96.53zm111.814 0v18.688h28.094V89.937h-28.094zm46.78 0v18.688h71.97V89.937h-71.97zM96.532 129.844v18.72h29.657v-18.72H96.53zm48.345 0v18.72h65.938v-18.72h-65.938zm84.656 0v18.72h38.095v-18.72H229.53zm56.782 0v18.72h40.782v-18.72h-40.78zM96.532 166.78v18.69h70.874v-18.69H96.53zm89.562 0v18.69h57.03v-18.69h-57.03zm75.72 0-.002 18.69h65.282v-18.69h-65.28zm92.342 90.25c-74.88 0-135.594 41.762-135.594 93.283 0 51.52 60.716 93.28 135.594 93.28 18.23 0 35.623-2.48 51.5-6.968l68.53 51.156-24.873-71.03c24.947-16.918 40.437-40.432 40.437-66.438 0-51.518-60.714-93.28-135.594-93.28zm-70.344 42.345h32.907v18.688H283.81v-18.688zm51.594 0h90.344v18.688h-90.344v-18.688zm-78.97 41.75h78.314v18.688h-78.313v-18.688zm97.002 0h20.968v18.688h-20.97l.002-18.688zm39.656 0h51v18.688h-51v-18.688zm-109.28 39h79.06v18.688h-79.062v-18.688zm97.748 0h44.188v18.688h-44.188v-18.688z" fill="#fff" fill-opacity="1" transform="translate(76.8, 76.8) scale(0.7, 0.7) rotate(0, 256, 256) skewX(0) skewY(0)"></path></g></svg> | ||||
| Before Width: | Height: | Size: 1.8 KiB | 
| @@ -1,54 +0,0 @@ | ||||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||||
| <svg | ||||
|    xmlns:dc="http://purl.org/dc/elements/1.1/" | ||||
|    xmlns:cc="http://creativecommons.org/ns#" | ||||
|    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||||
|    xmlns:svg="http://www.w3.org/2000/svg" | ||||
|    xmlns="http://www.w3.org/2000/svg" | ||||
|    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||||
|    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||||
|    viewBox="0 0 640 640" | ||||
|    version="1.1" | ||||
|    id="svg4" | ||||
|    sodipodi:docname="icon_sidebar_macros.svg" | ||||
|    inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"> | ||||
|   <metadata | ||||
|      id="metadata10"> | ||||
|     <rdf:RDF> | ||||
|       <cc:Work | ||||
|          rdf:about=""> | ||||
|         <dc:format>image/svg+xml</dc:format> | ||||
|         <dc:type | ||||
|            rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | ||||
|         <dc:title></dc:title> | ||||
|       </cc:Work> | ||||
|     </rdf:RDF> | ||||
|   </metadata> | ||||
|   <defs | ||||
|      id="defs8" /> | ||||
|   <sodipodi:namedview | ||||
|      pagecolor="#ffffff" | ||||
|      bordercolor="#666666" | ||||
|      borderopacity="1" | ||||
|      objecttolerance="10" | ||||
|      gridtolerance="10" | ||||
|      guidetolerance="10" | ||||
|      inkscape:pageopacity="0" | ||||
|      inkscape:pageshadow="2" | ||||
|      inkscape:window-width="2666" | ||||
|      inkscape:window-height="1514" | ||||
|      id="namedview6" | ||||
|      showgrid="false" | ||||
|      inkscape:zoom="1.6241359" | ||||
|      inkscape:cx="170.14667" | ||||
|      inkscape:cy="292.89075" | ||||
|      inkscape:window-x="0" | ||||
|      inkscape:window-y="0" | ||||
|      inkscape:window-maximized="0" | ||||
|      inkscape:current-layer="svg4" | ||||
|      units="in" /> | ||||
|   <path | ||||
|      d="m 378.25,116.16 c -13.6,-3.92 -27.76,4 -31.68,17.6 l -102.4,358.4 c -3.92,13.6 4,27.76 17.6,31.68 13.6,3.92 27.76,-4 31.68,-17.6 l 102.4,-358.4 c 3.92,-13.6 -4,-27.76 -17.6,-31.68 z m 51.68,108.88 c -10,10 -10,26.24 0,36.24 l 58.72,58.72 -58.72,58.72 c -10,10 -10,26.24 0,36.24 10,10 26.24,10 36.24,0 l 76.8,-76.8 c 10,-10 10,-26.24 0,-36.24 l -76.8,-76.8 c -10,-10 -26.24,-10 -36.24,0 z m -219.76,0 c -10,-10 -26.24,-10 -36.24,0 l -76.8,76.8 c -10,10 -10,26.24 0,36.24 l 76.8,76.8 c 10,10 26.24,10 36.24,0 10,-10 10,-26.24 0,-36.24 L 151.45,320 210.09,261.28 c 10,-10 10,-26.24 0,-36.24 z" | ||||
|      id="path2" | ||||
|      style="fill:#ffffff;stroke-width:0.8" /> | ||||
| </svg> | ||||
| Before Width: | Height: | Size: 2.1 KiB | 
							
								
								
									
										220
									
								
								changelog.md
									
									
									
									
									
								
							
							
						
						| @@ -1,142 +1,21 @@ | ||||
| # 13.0 | ||||
|  | ||||
| ## 13.0.9 - Le combat d'Illysis | ||||
| - Fix | ||||
|   - La montée en TMR fonctionne | ||||
| - Nouvelle fenêtre de jets de dés | ||||
|   - avancement du mode attaque | ||||
|     - choix de tactique | ||||
|     - choix des dommages, affichage | ||||
|     - affichage de la surprise du défenseur | ||||
|  | ||||
| ## 13.0.8 - Le renouveau d'Illysis | ||||
|  | ||||
| - Fix Foundry V13 | ||||
|   - Les états sont de nouveau affichés en ligne dans la feuille de personnage | ||||
|   - les icones spécifiques Rêve de Dragon de la barre de droite sont de nouveau utilisées | ||||
|  | ||||
| - Nouvelle fenêtre de jets de dés | ||||
|   - uniquement pour les oeuvres (chant, danse, musique, cuisine,...) | ||||
|   - à activer dans les options avancées | ||||
|  | ||||
| ## 13.0.7 - Sous le signe d'Illysis | ||||
|  | ||||
| - Fix Foundry V13 | ||||
|   - les tooltips des ajustements sont correctement visible | ||||
|   - correction des affichages des signes d'heures dans la fenêtre d'astrologie | ||||
|  | ||||
| - en cas d'appel au moral lorsqu'une double significative est requise, | ||||
|   le moral est perdu si la réussite est insuffisante | ||||
| - transformation du niveau des musiques/danses/chants/recettes de cuisine en valeur numérique | ||||
| - les effets draconiques sur une case inconnue (A0) ne causent plus de problèmes dans les TMRs | ||||
|  | ||||
| ## 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 | ||||
| @@ -146,14 +25,12 @@ | ||||
|   - 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 | ||||
| @@ -168,16 +45,14 @@ | ||||
|   - 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 | ||||
|     - 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 | ||||
| @@ -187,35 +62,28 @@ | ||||
| - 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 | ||||
| @@ -236,14 +104,12 @@ | ||||
|   - 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 | ||||
| @@ -251,9 +117,8 @@ | ||||
|   - 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 | ||||
| @@ -269,23 +134,19 @@ | ||||
|   - 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 | ||||
| @@ -302,13 +163,11 @@ | ||||
| - 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 | ||||
| @@ -316,7 +175,6 @@ | ||||
| - 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 | ||||
| @@ -325,18 +183,15 @@ | ||||
|   - 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 | ||||
| @@ -345,12 +200,10 @@ | ||||
|   - 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 | ||||
| @@ -360,7 +213,6 @@ | ||||
|   - 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 | ||||
| @@ -375,9 +227,8 @@ | ||||
| - 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 | ||||
| @@ -385,31 +236,27 @@ | ||||
|     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 | ||||
| @@ -424,16 +271,13 @@ | ||||
|   - 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 | ||||
| @@ -443,15 +287,12 @@ | ||||
| - 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 | ||||
| @@ -460,45 +301,37 @@ | ||||
| - 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 | ||||
| @@ -508,23 +341,19 @@ | ||||
| - 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 | ||||
| @@ -543,14 +372,11 @@ | ||||
|     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: | ||||
| @@ -564,15 +390,12 @@ 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) | ||||
| @@ -587,7 +410,6 @@ 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 | ||||
| @@ -597,18 +419,15 @@ 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 | ||||
| @@ -626,28 +445,24 @@ 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 | ||||
| @@ -666,57 +481,45 @@ 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 | ||||
| @@ -727,14 +530,12 @@ 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 | ||||
| @@ -757,3 +558,4 @@ Vu qu'elles ne peuvent pas être utilisées, permet de savoir pourquoi | ||||
| - correction des achats par le MJ sans acteur sélectionné | ||||
|  | ||||
| Cf branche v10 pour l'historique des versions 10 | ||||
|  | ||||
|   | ||||
							
								
								
									
										37
									
								
								gulpfile.js
									
									
									
									
									
								
							
							
						
						| @@ -1,37 +0,0 @@ | ||||
| const gulp = require('gulp'); | ||||
| const less = require('gulp-less'); | ||||
|  | ||||
| function onError(err) { | ||||
|   util.log(util.colors.red.bold('[ERROR LESS]:'),util.colors.bgRed(err.message)); | ||||
|   this.emit('end'); | ||||
| }; | ||||
|  | ||||
| /* ----------------------------------------- */ | ||||
| /*  Compile LESS | ||||
| /* ----------------------------------------- */ | ||||
| function compileLESS() { | ||||
|   return gulp.src("less/foundryvtt-reve-de-dragon.less") | ||||
|       .pipe(less()).on('error',console.log.bind(console)) | ||||
|       .pipe(gulp.dest("./css")) | ||||
| } | ||||
| const css = gulp.series(compileLESS); | ||||
|  | ||||
| /* ----------------------------------------- */ | ||||
| /*  Watch Updates | ||||
| /* ----------------------------------------- */ | ||||
| const SIMPLE_LESS = ["less/*.less", "less/item/*.less"]; | ||||
|  | ||||
| function watchUpdates() { | ||||
|   gulp.watch(SIMPLE_LESS, css); | ||||
| } | ||||
|  | ||||
| /* ----------------------------------------- */ | ||||
| /*  Export Tasks | ||||
| /* ----------------------------------------- */ | ||||
|  | ||||
| exports.default = gulp.series( | ||||
|     gulp.parallel(css), | ||||
|     watchUpdates | ||||
| ); | ||||
| exports.css = css; | ||||
| exports.watchUpdates = watchUpdates; | ||||
| @@ -1,58 +0,0 @@ | ||||
| :root { | ||||
|  | ||||
|   /* =================== 2. DEBUGGING HIGHLIGHTERS ============ */ | ||||
|     // --debug-background-color-red: #ff000054; | ||||
|     // --debug-background-color-blue: #1d00ff54; | ||||
|     // --debug-background-color-green: #54ff0054; | ||||
|  | ||||
|     // --debug-box-shadow-red: inset 0 0 2px red; | ||||
|     // --debug-box-shadow-blue: inset 0 0 2px blue; | ||||
|     // --debug-box-shadow-green: inset 0 0 2px green; | ||||
|  | ||||
|  | ||||
|   /* =================== 3. some constants ============ */ | ||||
|     --fieldset-background: url(/ui/parchment.jpg); | ||||
|     --rdd-color-text-primary: hsla(0, 0%, 4%, 0.9); | ||||
|     --rdd-input-background:hsla(0, 0%, 0%, 0.1); | ||||
|     --rdd-color-border-input: hsla(0, 0%, 0%, 0.2); | ||||
|     --rdd-bg-input: hsla(0, 0%, 100%, 0.1); | ||||
|     --color-controls:hsla(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:hsla(30, 100%, 50%, 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, hsla(208, 38%, 21%, 0.988) 5%, hsla(202, 42%, 14%, 0.671) 100%); | ||||
|     --background-custom-button-hover: linear-gradient(to bottom, hsla(0, 100%, 25%, 1) 5%, hsla(0, 97%, 12%, 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); | ||||
|     --background-tooltip-alt: hsla(60, 12%, 74%, 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); | ||||
|  | ||||
|     --color-background-chat-message: hsla(60, 12%, 85%, 0.9); | ||||
|     --color-background-chat-whisper: repeating-linear-gradient(120deg, | ||||
|       hsla(60, 12%, 85%, 0.75), | ||||
|       hsla(60, 12%, 85%, 0.75) 1rem,  | ||||
|       hsla(60, 12%, 85%, 0.8) 1rem,  | ||||
|       hsla(60, 12%, 85%, 0.75) 1.5rem); | ||||
|   } | ||||
| @@ -1,85 +0,0 @@ | ||||
| /* ==================== (A) Fonts ==================== */ | ||||
| @font-face { | ||||
|   font-family: "GoudyAcc"; | ||||
|   src: url('../fonts/goudyacc.ttf') format("truetype"); | ||||
| } | ||||
| @font-face { | ||||
|   font-family: "MedievalSharp"; | ||||
|   src: url('../fonts/MedievalSharp.ttf') format("truetype"); | ||||
| } | ||||
| @font-face { | ||||
|   font-family: "GrenzeGotisch"; | ||||
|   src: url('../fonts/GrenzeGotisch-Regular.ttf') format("truetype"); | ||||
| } | ||||
| @font-face { | ||||
|   font-family: "Fondamento"; | ||||
|   src: url('../fonts/Fondamento.ttf') format("truetype"); | ||||
| } | ||||
| @font-face { | ||||
|   font-family: "CaslonAntique"; | ||||
|   src: url('../fonts/CaslonAntique.ttf') format("truetype"); | ||||
| } | ||||
| @font-face { | ||||
|   font-family: 'HeuresDraconiques'; | ||||
|   src: | ||||
|       url('../fonts/heuresdraconiques2.woff') format('woff'), | ||||
|       url('../fonts/heuresdraconiques2.woff2') format('woff2'), | ||||
|       url('../fonts/heuresdraconiques2.ttf') format('truetype'); | ||||
|   font-weight: normal; | ||||
|   font-style: normal; | ||||
| } | ||||
|  | ||||
| :root { | ||||
|   /* =================== 1. ACTOR SHEET FONT STYLES =========== */ | ||||
|     --window-header-title-font-family: CaslonAntique; | ||||
|     --window-header-title-font-size: 1.6rem; | ||||
|     --window-header-title-font-weight: normal; | ||||
|     --window-header-title-color: #f5f5f5; | ||||
|  | ||||
|     --major-button-font-family: CaslonAntique; | ||||
|     --major-button-font-size: 1.4rem; | ||||
|     --major-button-font-weight: normal; | ||||
|     --major-button-color: #dadada; | ||||
|  | ||||
|     --tab-header-font-family: CaslonAntique; | ||||
|     --tab-header-font-size: 1.2rem; | ||||
|     --tab-header-font-weight: 700; | ||||
|     --tab-header-color: #403f3e; | ||||
|     --tab-header-color-active: #4a0404; | ||||
|  | ||||
|     --actor-input-font-family: CaslonAntique; | ||||
|     --actor-input-font-size: 1.2rem; | ||||
|     --actor-input-font-weight: 500; | ||||
|     --actor-input-color: black; | ||||
|  | ||||
|     --actor-label-font-family: CaslonAntique; | ||||
|     --actor-label-font-size: 1.2rem; | ||||
|     --actor-label-font-weight: 700; | ||||
|     --actor-label-color: #464331c4; | ||||
| } | ||||
|  | ||||
| /* Global styles & Font */ | ||||
| .application, | ||||
| .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 */ | ||||
| } | ||||
| @@ -1,7 +0,0 @@ | ||||
| // Styles pour la feuille d'objet Monnaie | ||||
| .monnaie-content { | ||||
|  | ||||
|   .item-sheet-common(); | ||||
|   .item-sheet-header(); | ||||
|  | ||||
| } | ||||
| @@ -1,7 +0,0 @@ | ||||
| // Styles pour la feuille d'objet Monnaie | ||||
| .munition-content { | ||||
|  | ||||
|   .item-sheet-common(); | ||||
|   .item-sheet-header(); | ||||
|  | ||||
| } | ||||
| @@ -1,7 +0,0 @@ | ||||
| // Styles pour la feuille d'objet Monnaie | ||||
| .tarot-content { | ||||
|  | ||||
|   .item-sheet-common(); | ||||
|   .item-sheet-header(); | ||||
|  | ||||
| } | ||||
| @@ -1,229 +0,0 @@ | ||||
| .roll-dialog { | ||||
|   font-family: CaslonAntique; | ||||
|   display: grid; | ||||
|   grid-template-areas: | ||||
|     "header header     header     header     header     header     header" | ||||
|     "action action     action     action     action     action     action" | ||||
|     "mode   separation separation separation separation separation separation" | ||||
|     "mode   carac      carac      carac      comp       comp       resume" | ||||
|     "mode   choix      choix      choix      choix      choix      modifiers" | ||||
|     "mode   resolution resolution resolution resolution resolution modifiers" | ||||
|     "mode   chances    chances    chances    chances    chances    buttons" | ||||
|     "footer footer     footer     footer     footer     footer     footer"; | ||||
|   grid-template-columns: 2rem 1rem 1fr 1fr 2fr 2fr 3fr; | ||||
|   gap: 0.2rem; | ||||
|  | ||||
|   roll-header { grid-area: header; } | ||||
|   roll-line  { grid-area: separation; } | ||||
|   roll-action { grid-area: action; } | ||||
|   roll-carac { grid-area: carac; } | ||||
|   roll-comp { grid-area: comp; } | ||||
|    | ||||
|   roll-choix { grid-area: choix; } | ||||
|    | ||||
|   roll-table { grid-area: resolution; } | ||||
|   roll-conditions { grid-area: modifiers; } | ||||
|   roll-chances { grid-area: chances; } | ||||
|   roll-resume { grid-area: resume; } | ||||
|   roll-buttons  { grid-area: buttons; } | ||||
|    | ||||
|   roll-mode { | ||||
|     grid-area: mode; | ||||
|     display: flex; | ||||
|     flex-direction: column; | ||||
|   } | ||||
|   roll-conditions roll-section[name="rollmode"], | ||||
|   roll-mode { | ||||
|     button[data-checked="true"] { | ||||
|       background-color: var(--color-text-selection-bg); | ||||
|       color: var(--color-controls); | ||||
|       i { filter: invert(0.8); } | ||||
|       img { filter: invert(0.2); } | ||||
|     } | ||||
|     button { | ||||
|       height: 1.8rem; | ||||
|       width: 1.8rem; | ||||
|       gap: 0.5rem; | ||||
|       padding: 0.2rem; | ||||
|       background-color: var(--button-background-color); | ||||
|       color: var(--color-controls); | ||||
|       i { filter: invert(0.2); } | ||||
|       img { filter: invert(0.8); } | ||||
|     } | ||||
|   } | ||||
|    | ||||
|   :is(roll-carac, roll-comp) { | ||||
|     display: flex; | ||||
|     flex-direction: row; | ||||
|     align-items: baseline; | ||||
|   } | ||||
|    | ||||
|   roll-section, | ||||
|   roll-section div { | ||||
|     display: flex; | ||||
|     flex-direction: row; | ||||
|     align-items: anchor-center; | ||||
|     margin: 0 0.2rem; | ||||
|   } | ||||
|    | ||||
|   roll-resume { | ||||
|     display: flex; | ||||
|     flex-direction: row; | ||||
|     img.button-effect-img { | ||||
|       filter: invert(0.8); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   roll-choix roll-section { | ||||
|     display: grid; | ||||
|     grid-template-areas: | ||||
|       "selection selection" | ||||
|       "img roll-part"; | ||||
|     grid-template-columns: 3.2rem 1fr; | ||||
|     gap: 0.2rem; | ||||
|     align-items: start; | ||||
|  | ||||
|      | ||||
|     subline { | ||||
|       grid-area: selection; | ||||
|       display: flex; | ||||
|       flex-direction: row; | ||||
|       margin: 0.1rem 0; | ||||
|     } | ||||
|    | ||||
|     roll-part-img { | ||||
|       display: flex; | ||||
|       flex-direction: column; | ||||
|       grid-area: img; | ||||
|       img{ | ||||
|         border: 0; | ||||
|         padding: 1px; | ||||
|         max-height: 3rem; | ||||
|         max-width: 3rem; | ||||
|         object-fit: contain; | ||||
|         height: 100%; | ||||
|       } | ||||
|     } | ||||
|     roll-part-detail { | ||||
|       grid-area: roll-part; | ||||
|       display: flex; | ||||
|       flex-direction: column; | ||||
|       align-items: normal; | ||||
|        | ||||
|       subline { | ||||
|         display: flex; | ||||
|         flex-direction: row; | ||||
|         margin: 0.1rem 0; | ||||
|         div.poesie-extrait{ | ||||
|           display: flex; | ||||
|           flex-direction: column; | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   roll-section selected-numeric-value { | ||||
|     display: flow; | ||||
|     width: 2.5rem; | ||||
|     text-align: right; | ||||
|     margin: 0 0.2rem 0 0.5rem; | ||||
|     padding: 0 0.2rem; | ||||
|   } | ||||
|  | ||||
|   roll-action { | ||||
|     flex-basis: content; | ||||
|     display: flex; | ||||
|     flex-direction: row; | ||||
|     align-items: center; | ||||
|     border-bottom: 0.2rem solid; | ||||
|     font-size: 1.2rem; | ||||
|     font-weight: bold; | ||||
|      | ||||
|     roll-section { | ||||
|       display: flex; | ||||
|       flex-direction: row; | ||||
|       align-items: center; | ||||
|  | ||||
|       img.action-img { | ||||
|         float: left; | ||||
|       } | ||||
|       img { | ||||
|         max-width: 3rem; | ||||
|         max-height: 3rem; | ||||
|         margin: 0 1rem; | ||||
|         padding: 0; | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   roll-conditions { | ||||
|     display: flex; | ||||
|     flex-direction: column; | ||||
|   } | ||||
|   :is(roll-action, roll-carac, roll-comp) roll-section { | ||||
|     flex-basis: content; | ||||
|   }   | ||||
|  | ||||
|   :is(roll-choix, roll-conditions, roll-carac, roll-comp) { | ||||
|     select { | ||||
|       max-height: 1.6rem; | ||||
|       margin: 0 0.2rem; | ||||
|       padding: 0 0.2rem; | ||||
|     } | ||||
|     input[type="number"] { | ||||
|       max-height: 1.6rem; | ||||
|       max-width: 2.5rem; | ||||
|       margin: 0 0.2rem; | ||||
|       padding: 0 0.2rem; | ||||
|     } | ||||
|     img { | ||||
|           max-width: 1.8rem; | ||||
|           max-height: 1.8rem; | ||||
|           margin: 0 0.2rem; | ||||
|           padding: 0; | ||||
|     } | ||||
|     img.button-effect-img { | ||||
|           max-width: 1rem; | ||||
|           max-height: 1rem; | ||||
|           margin: 0 0.1rem; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   roll-carac select[name="select-carac"] { | ||||
|     max-width: 6rem; | ||||
|  | ||||
|   }     | ||||
|   roll-comp select[name="select-comp"] { | ||||
|     min-width: 8rem; | ||||
|     max-width: 11rem; | ||||
|     margin-left: 1rem; | ||||
|   }      | ||||
|  | ||||
|   roll-conditions roll-section[name="coeur"] select[name="coeur"]  { | ||||
|     max-width: 4rem; | ||||
|   } | ||||
|  | ||||
|   roll-conditions roll-section[name="tricher"] img { | ||||
|     /* image de d100 */ | ||||
|     max-width: 2.5rem; | ||||
|     max-height: 2.5rem; | ||||
|     gap: 0; | ||||
|     margin: 0; | ||||
|     padding: 0; | ||||
|     filter: invert(0.8); | ||||
|   } | ||||
|  | ||||
|   roll-buttons {  | ||||
|     display: flex; | ||||
|     flex-direction: row-reverse; | ||||
|   } | ||||
|  | ||||
|   roll-table { | ||||
|     table tr :is(th, td) { | ||||
|         padding: 0.1rem; | ||||
|         width: 1.5rem; | ||||
|         text-align: center; | ||||
|     } | ||||
|   } | ||||
|  | ||||
| } | ||||
							
								
								
									
										108
									
								
								less/sheets.less
									
									
									
									
									
								
							
							
						
						| @@ -1,108 +0,0 @@ | ||||
| .item-sheet-common() { | ||||
|   padding: 0px; | ||||
|  | ||||
|   // Styles pour la section de description, si le partiel utilise une structure standard | ||||
|   .editor, | ||||
|   .editor-content { | ||||
|     height: auto; // Ajuster selon le besoin | ||||
|     min-height: 100px; // Hauteur minimale pour la description | ||||
|     background: var(--rdd-bg-input-alt); // Une couleur de fond alternative | ||||
|     padding: 5px; | ||||
|     border-radius: 3px; | ||||
|     color: var(--rdd-color-text-primary); | ||||
|   } | ||||
|  | ||||
|   .window-content { | ||||
|     font-family: CaslonAntique; | ||||
|     text-align: justify; | ||||
|     font-size: 1rem; | ||||
|     letter-spacing: 1px; | ||||
|     padding: 0% 0 0 0; | ||||
|  | ||||
|     font-size: calc(var(--font-size-standard) * 1); | ||||
|     color: var(--color-dark-1); | ||||
|     background-size: 100% 100%; | ||||
|   } | ||||
|  | ||||
|   fieldset { | ||||
|     background: var(--fieldset-background); | ||||
|     color: var(--rdd-color-text-primary); | ||||
|     margin-bottom: 4px; | ||||
|     border-radius: 6px; | ||||
|     border-color: var(--rdd-color-text-primary); | ||||
|     border-width: 2px; | ||||
|   } | ||||
|  | ||||
|   .form-group { | ||||
|     display: flex; | ||||
|     flex-direction: row; | ||||
|     flex-wrap: wrap; | ||||
|     justify-content: flex-start; | ||||
|     align-items: center; | ||||
|     padding: 2px 0; | ||||
|     border-bottom: 1px solid var(--rdd-color-shadow-primary); | ||||
|     font-size: 0.9rem; | ||||
|  | ||||
|     label { | ||||
|       font-weight: normal; | ||||
|       flex: 2; | ||||
|       padding-left: 5px; | ||||
|       margin: 0; | ||||
|       color: var( | ||||
|         --rdd-color-text-primary | ||||
|       ); // Assurez-vous que cette variable existe dans colors.less | ||||
|     } | ||||
|  | ||||
|     .attribute-value, | ||||
|     input[type="text"], | ||||
|     input[type="number"], | ||||
|     select { | ||||
|       flex: 3; | ||||
|       background: var(--rdd-input-background); | ||||
|       border: 1px solid var(--rdd-color-border-input); // Assurez-vous que cette variable existe | ||||
|       color: var( | ||||
|         --rdd-color-text-input | ||||
|       ); // Assurez-vous que cette variable existe | ||||
|       padding: 2px 2px; // Augmentation du padding vertical | ||||
|       border-radius: 3px; | ||||
|     } | ||||
|  | ||||
|     input[type="checkbox"] { | ||||
|       flex: 0 0 20px; // Taille fixe pour les cases à cocher | ||||
|       margin-left: 5px; | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| .item-sheet-header() { | ||||
|   background: #011d33 url(../assets/ui/bg_header.webp) no-repeat left top; | ||||
|   color: rgba(255, 255, 255, 1); | ||||
|   .sheet-header-row { | ||||
|     display: flex; | ||||
|     flex-direction: row; | ||||
|     align-items: center; | ||||
|     h1, | ||||
|     input { | ||||
|       font-family: CaslonAntique; | ||||
|       font-size: 2.5rem; | ||||
|       font-weight: normal; | ||||
|       color: var(--window-header-title-color); | ||||
|       margin: 4px; | ||||
|       height: 3rem; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   :is( | ||||
|     input[type="text"], | ||||
|     input[type="number"], | ||||
|     input[type="password"], | ||||
|     input[type="datetime-local"], | ||||
|     input[type="date"], | ||||
|     input[type="time"] | ||||
|   ) { | ||||
|     color: rgba(255, 255, 255, 0.75); | ||||
|     background: rgba(255, 255, 255, 0.1); | ||||
|     border: 0 none; | ||||
|     margin-bottom: 0.2rem; | ||||
|   } | ||||
| } | ||||
| @@ -1,5 +1,7 @@ | ||||
| import { RdDUtility } from "./rdd-utility.js"; | ||||
| import { HtmlUtility } from "./html-utility.js"; | ||||
| import { RdDItemArme } from "./item-arme.js"; | ||||
| import { RdDItemCompetence } from "./item-competence.js"; | ||||
| import { RdDBonus } from "./rdd-bonus.js"; | ||||
| import { Misc } from "./misc.js"; | ||||
| import { RdDCombatManager } from "./rdd-combat.js"; | ||||
| @@ -7,12 +9,11 @@ import { RdDCarac } from "./rdd-carac.js"; | ||||
| import { DialogSplitItem } from "./dialog-split-item.js"; | ||||
| import { ReglesOptionnelles } from "./settings/regles-optionnelles.js"; | ||||
| import { RdDSheetUtility } from "./rdd-sheet-utility.js"; | ||||
| import { STATUSES } from "./settings/status-effects.js"; | ||||
| import { MAINS_DIRECTRICES } from "./actor.js"; | ||||
| import { RdDBaseActorReveSheet } from "./actor/base-actor-reve-sheet.js"; | ||||
| import { ITEM_TYPES } from "./constants.js"; | ||||
| import { RdDItem } from "./item.js"; | ||||
| import { RdDItemArme } from "./item/arme.js"; | ||||
| import { RdDItemCompetence } from "./item-competence.js"; | ||||
| import { RdDItemBlessure } from "./item/blessure.js"; | ||||
| import { RdDEmpoignade } from "./rdd-empoignade.js"; | ||||
| import { RdDBaseActorSangSheet } from "./actor/base-actor-sang-sheet.js"; | ||||
| @@ -33,7 +34,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet { | ||||
|       width: 550, | ||||
|       showCompNiveauBase: false, | ||||
|       vueArchetype: false, | ||||
|     }, { inplace: false }) | ||||
|     }, { inplace: false }); | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
| @@ -49,7 +50,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet { | ||||
|     }); | ||||
|     foundry.utils.mergeObject(formData.calc, { | ||||
|       surenc: this.actor.computeMalusSurEncombrement(), | ||||
|       surprise: RdDBonus.find(this.actor.getSurprise(false)).label, | ||||
|       surprise: RdDBonus.find(this.actor.getSurprise(false)).descr, | ||||
|       resumeBlessures: this.actor.computeResumeBlessure(this.actor.system.blessures), | ||||
|       caracTotal: RdDCarac.computeTotal(this.actor.system.carac, this.actor.system.beaute), | ||||
|       surEncombrementMessage: this.actor.isSurenc() ? "Sur-Encombrement!" : "", | ||||
| @@ -77,10 +78,14 @@ export class RdDActorSheet extends RdDBaseActorSangSheet { | ||||
|       }); | ||||
|  | ||||
|       // toujours avoir une liste d'armes (pour mettre esquive et corps à corps) | ||||
|       const actor = this.actor | ||||
|       const actor = this.actor; | ||||
|       formData.combat = foundry.utils.duplicate(formData.armes); | ||||
|       RdDItemArme.computeNiveauArmes(formData.combat, formData.competences); | ||||
|       formData.combat.push(RdDItemArme.corpsACorps(actor)); | ||||
|       formData.combat.push(RdDItemArme.empoignade(actor)); | ||||
|  | ||||
|       formData.esquives = this.actor.getCompetencesEsquive() | ||||
|       formData.combat = actor.listActionsAttaque() | ||||
|       formData.combat = RdDCombatManager.listActionsArmes(formData.combat, formData.competences, formData.system.carac); | ||||
|       formData.empoignades = this.actor.getEmpoignades(); | ||||
|  | ||||
|       this.armesList = formData.combat; | ||||
| @@ -90,7 +95,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet { | ||||
|       formData.difficultesLibres = CONFIG.RDD.difficultesLibres; | ||||
|  | ||||
|       formData.hautreve = { | ||||
|         isDemiReve: this.actor.isDemiReve(), | ||||
|         isDemiReve: this.actor.getEffect(STATUSES.StatusDemiReve), | ||||
|         cacheTMR: this.actor.isTMRCache() | ||||
|       } | ||||
|  | ||||
| @@ -212,17 +217,13 @@ export class RdDActorSheet extends RdDBaseActorSangSheet { | ||||
|     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 => { | ||||
|       const action = this._getActionCombat(event); | ||||
|       await this.actor.rollArme(action.arme, action.main) | ||||
|  | ||||
|     }) | ||||
|     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 => { | ||||
|       let combatant = game.combat.combatants.find(c => c.actor.id == this.actor.id) | ||||
|       if (combatant) { | ||||
|         RdDCombatManager.rollInitiativeAction(combatant._id, this._getActionCombat(event)); | ||||
|         RdDCombatManager.rollInitiativeAction(combatant._id, this._getEventArmeCombat(event)); | ||||
|       } else { | ||||
|         ui.notifications.info("Impossible de lancer l'initiative sans être dans un combat."); | ||||
|       } | ||||
| @@ -236,11 +237,11 @@ export class RdDActorSheet extends RdDBaseActorSangSheet { | ||||
|  | ||||
|     this.html.find('.carac-xp-augmenter').click(async event => await this.actor.updateCaracXPAuto(event.currentTarget.name.replace("augmenter.", ""))) | ||||
|     this.html.find('.competence-xp-augmenter').click(async event => await this.actor.updateCompetenceXPAuto(RdDSheetUtility.getItemId(event))) | ||||
|     this.html.find('.competence-stress-augmenter').click(async 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 | ||||
| @@ -346,17 +347,13 @@ export class RdDActorSheet extends RdDBaseActorSangSheet { | ||||
|     await this.actor.createItem('tache', 'Nouvelle tache'); | ||||
|   } | ||||
|  | ||||
|   _getActionCombat(event) { | ||||
|   _getEventArmeCombat(event) { | ||||
|     const li = this.html.find(event.currentTarget)?.parents(".item"); | ||||
|     let armeName = li.data("arme-name"); | ||||
|     let compName = li.data('competence-name'); | ||||
|     const arme = this.armesList.find(a => a.arme.name == armeName && a.comp.name == compName); | ||||
|     const arme = this.armesList.find(a => a.name == armeName && a.system.competence == compName); | ||||
|     if (!arme) { | ||||
|       return { | ||||
|         name: armeName, | ||||
|         arme: { name: armeName }, | ||||
|         comp: { name: compName } | ||||
|       } | ||||
|       return { name: armeName, system: { competence: compName } }; | ||||
|     } | ||||
|     return arme; | ||||
|   } | ||||
|   | ||||
| @@ -1,40 +0,0 @@ | ||||
| /** | ||||
|  * class providing the actor and token, and choosing the name and image from the token if available. | ||||
|  */ | ||||
| export class ActorToken { | ||||
|  | ||||
|   static fromActorId(actorId, onError = () => undefined) { | ||||
|     actorId = actorId ?? (canvas.tokens.controlled.length > 0 | ||||
|       ? canvas.tokens.controlled[0].actor.id | ||||
|       : undefined) | ||||
|     const actor = actorId ? game.actors.get(actorId) : undefined | ||||
|     if (actor) { | ||||
|       return this.fromActor(actor) | ||||
|     } | ||||
|     return onError() | ||||
|   } | ||||
|  | ||||
|   static fromActor(actor) { | ||||
|     const token = actor.isToken ? actor.token : actor.prototypeToken | ||||
|     return ActorToken.fromToken(token) | ||||
|   } | ||||
|  | ||||
|   static fromTokenId(tokenId, sceneId = undefined) { | ||||
|     const tokensList = sceneId ? game.scenes.get(sceneId).tokens : canvas.tokens.placeables | ||||
|     const token = tokensList.get(tokenId) | ||||
|     return ActorToken.fromToken(token) | ||||
|   } | ||||
|  | ||||
|   static fromToken(token) { | ||||
|     return new ActorToken(token) | ||||
|   } | ||||
|  | ||||
|   constructor(token) { | ||||
|     this.name = token.name ?? token.actor.name | ||||
|     this.img = token.actor.isToken && token.texture.src ? token.texture.src : token.actor.img | ||||
|     this.actor = token.actor | ||||
|     this.id = token.actor?.id | ||||
|     this.token = token | ||||
|     this.tokenId = token?.id | ||||
|   } | ||||
| } | ||||
							
								
								
									
										674
									
								
								module/actor.js
									
									
									
									
									
								
							
							
						
						| @@ -8,9 +8,12 @@ import { RdDResolutionTable } from "./rdd-resolution-table.js"; | ||||
| import { RdDDice } from "./rdd-dice.js"; | ||||
| import { RdDRollTables } from "./rdd-rolltables.js"; | ||||
| import { ChatUtility } from "./chat-utility.js"; | ||||
| import { RdDItemSort } from "./item-sort.js"; | ||||
| import { Grammar } from "./grammar.js"; | ||||
| import { RdDItemCompetence } from "./item-competence.js"; | ||||
| import { RdDAlchimie } from "./rdd-alchimie.js"; | ||||
| import { STATUSES } from "./settings/status-effects.js"; | ||||
| import { RdDItemSigneDraconique } from "./item/signedraconique.js"; | ||||
| import { ReglesOptionnelles } from "./settings/regles-optionnelles.js"; | ||||
| import { EffetsDraconiques } from "./tmr/effets-draconiques.js"; | ||||
| import { Draconique } from "./tmr/draconique.js"; | ||||
| @@ -19,11 +22,13 @@ import { DialogConsommer } from "./dialog-item-consommer.js"; | ||||
| import { DialogFabriquerPotion } from "./dialog-fabriquer-potion.js"; | ||||
| import { RollDataAjustements } from "./rolldata-ajustements.js"; | ||||
| import { RdDPossession } from "./rdd-possession.js"; | ||||
| import { ACTOR_TYPES, SHOW_DICE, SYSTEM_RDD, SYSTEM_SOCKET_ID } from "./constants.js"; | ||||
| import { SHOW_DICE, SYSTEM_RDD, SYSTEM_SOCKET_ID } from "./constants.js"; | ||||
| import { RdDConfirm } from "./rdd-confirm.js"; | ||||
| import { RdDRencontre } from "./item/rencontre.js"; | ||||
| import { DialogRepos } from "./sommeil/dialog-repos.js"; | ||||
| import { RdDBaseActor } from "./actor/base-actor.js"; | ||||
| import { RdDTimestamp } from "./time/rdd-timestamp.js"; | ||||
| import { RdDItemBlessure } from "./item/blessure.js"; | ||||
| import { AppAstrologie } from "./sommeil/app-astrologie.js"; | ||||
| import { RdDEmpoignade } from "./rdd-empoignade.js"; | ||||
| import { ExperienceLog, XP_TOPIC } from "./actor/experience-log.js"; | ||||
| @@ -31,23 +36,13 @@ import { ITEM_TYPES } from "./constants.js"; | ||||
| import { RdDBaseActorSang } from "./actor/base-actor-sang.js"; | ||||
| import { RdDCoeur } from "./coeur/rdd-coeur.js"; | ||||
| import { DialogChoixXpCarac } from "./dialog-choix-xp-carac.js"; | ||||
| import { RdDItemArme } from "./item-arme.js"; | ||||
| import { RdDCombatManager } from "./rdd-combat.js"; | ||||
|  | ||||
| import { RdDItemArme } from "./item/arme.js"; | ||||
| import { RdDItemBlessure } from "./item/blessure.js"; | ||||
| import { RdDItemTete } from "./item/tete.js"; | ||||
| import { RdDItemSort } from "./item-sort.js"; | ||||
| import { RdDItemRace } from "./item/race.js"; | ||||
| import { RdDItemCompetence } from "./item-competence.js"; | ||||
| import { RdDItemSigneDraconique } from "./item/signedraconique.js"; | ||||
| import { RdDRencontre } from "./item/rencontre.js"; | ||||
| import { DialogSelect } from "./dialog-select.js"; | ||||
| import { PAS_DE_DRACONIC, POSSESSION_SANS_DRACONIC } from "./item/base-items.js"; | ||||
|  | ||||
| import { RdDItemRace } from "./item/race.js"; | ||||
| import { RdDRollResult } from "./rdd-roll-result.js"; | ||||
| import { RdDInitiative } from "./initiative.mjs"; | ||||
| import RollDialog from "./roll/roll-dialog.mjs"; | ||||
| import { OptionsAvancees, ROLL_DIALOG_V2 } from "./settings/options-avancees.js"; | ||||
|  | ||||
| export const MAINS_DIRECTRICES = ['Droitier', 'Gaucher', 'Ambidextre'] | ||||
|  | ||||
| @@ -110,7 +105,7 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|     return Number.isNumeric(this.system.compteurs.chance.value) ? | ||||
|       Misc.toInt(this.system.compteurs.chance.value) : this.getChance() | ||||
|   } | ||||
|   getMoralTotal() { return parseInt(this.system.compteurs.moral?.value ?? 0) } | ||||
|   getMoralTotal() { return this.system.compteurs.moral?.value ?? 0 } | ||||
|  | ||||
|   getEnduranceMax() { return Math.max(1, Math.max(this.getTaille() + this.getConstitution(), this.getVieMax() + this.getVolonte())) } | ||||
|  | ||||
| @@ -118,10 +113,8 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|   getEtatGeneral(options = { ethylisme: false }) { | ||||
|     const etatGeneral = this.system.compteurs.etat?.value ?? 0 | ||||
|     // Pour les jets d'Ethylisme, on retire le malus d'éthylisme (p.162) | ||||
|     if (options.ethylisme) { | ||||
|       return etatGeneral - this.malusEthylisme() | ||||
|     } | ||||
|     return etatGeneral | ||||
|     const annuleMalusEthylisme = options.ethylisme ? this.malusEthylisme() : 0 | ||||
|     return etatGeneral - annuleMalusEthylisme | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
| @@ -136,13 +129,19 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|       .reduce(Misc.sum(), 0); | ||||
|   } | ||||
|  | ||||
|   listActions({ isAttaque = false, isEquipe = false }) { | ||||
|   listActionsCombat() { | ||||
|     // Recupération des armes | ||||
|     const actions = this.listActionsAttaque() | ||||
|       .filter(it => !isEquipe || it.arme.system.equipe) | ||||
|     const actions = RdDCombatManager.listActionsArmes( | ||||
|       this.itemTypes[ITEM_TYPES.arme] | ||||
|         .filter(it => RdDItemArme.isAttaque(it)) | ||||
|         .concat(RdDItemArme.corpsACorps(this)) | ||||
|         .concat(RdDItemArme.empoignade(this)) | ||||
|       , | ||||
|       this.itemTypes[ITEM_TYPES.competence], | ||||
|       this.system.carac) | ||||
|  | ||||
|     if (!isAttaque && this.system.attributs.hautrevant.value) { | ||||
|       actions.push({ name: "Draconic", action: 'haut-reve', initOnly: true }) | ||||
|     if (this.system.attributs.hautrevant.value) { | ||||
|       actions.push({ name: "Draconic", action: 'haut-reve', system: { initOnly: true, competence: "Draconic" } }); | ||||
|     } | ||||
|     return actions | ||||
|   } | ||||
| @@ -167,85 +166,6 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|       .find(it => true) | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   /** Retourne une liste triée d'actions d'armes avec le split arme1 main / arme 2 main / lancer */ | ||||
|   listActionsAttaque() { | ||||
|     const actions = [] | ||||
|     const uniques = [] | ||||
|  | ||||
|     const addAttaque = (arme, main) => { | ||||
|       const dommages = arme.system.dommages.toString() | ||||
|       const tableauDommages = dommages.includes("/") ? dommages.split("/") : [dommages, dommages] | ||||
|       const dommagesArme = parseInt(main == '(2 mains)' ? tableauDommages[1] : tableauDommages[0]) | ||||
|       const magieEfficacite = arme.system.magique ? arme.system.ecaille_efficacite : 0; | ||||
|  | ||||
|       const comp = this.getCompetence(RdDActor.$getCompetenceAction(arme, main)) | ||||
|       const unique = [comp.id, arme.name, dommagesArme, magieEfficacite].join('|'); | ||||
|       if (uniques.includes(unique)) { | ||||
|         return | ||||
|       } | ||||
|       uniques.push(unique); | ||||
|  | ||||
|       const caracCode = RdDActor.$getCaracAction(comp, main) | ||||
|       const caracValue = this.system.carac[caracCode].value | ||||
|  | ||||
|       // TODO: déplacer sur RdDItemArme | ||||
|       if (arme.system.unemain && arme.system.deuxmains && !dommages.includes("/")) { | ||||
|         ui.notifications.info(`Les dommages de l'arme à 1/2 mains ${arme.name} ne sont pas corrects (ie sous la forme X/Y)`) | ||||
|       } | ||||
|       const niveau = comp?.system.niveau ?? (['(lancer)', '(tir)'].includes(main) ? -8 : -6) | ||||
|       const ajustement = (arme.parent?.getEtatGeneral() ?? 0) + magieEfficacite | ||||
|  | ||||
|       actions.push({ | ||||
|         name: arme.name + (main ? ' ' + main : ''), | ||||
|         action: 'attaque', | ||||
|         initOnly: false, | ||||
|         arme: arme, | ||||
|         comp: comp, | ||||
|         main: main, | ||||
|         carac: { key: caracCode, value: caracValue }, | ||||
|         equipe: arme.system.equipe, | ||||
|         dommagesArme: dommagesArme, | ||||
|         initiative: RdDInitiative.calculInitiative(niveau, caracValue, ajustement) | ||||
|       }) | ||||
|     } | ||||
|  | ||||
|     addAttaque(RdDItemArme.empoignade(this)) | ||||
|     addAttaque(RdDItemArme.corpsACorps(this)) | ||||
|  | ||||
|     this.itemTypes[ITEM_TYPES.arme] | ||||
|       .filter(it => RdDItemArme.isAttaque(it)) | ||||
|       .sort(Misc.ascending(it => it.name)) | ||||
|       .forEach(arme => { | ||||
|         if (arme.system.unemain && arme.system.competence) { addAttaque(arme, '(1 main)') } | ||||
|         if (arme.system.deuxmains && arme.system.competence) { addAttaque(arme, '(2 mains)') } | ||||
|         if (arme.system.lancer) { addAttaque(arme, '(lancer)') } | ||||
|         if (arme.system.tir) { addAttaque(arme, '(tir)') } | ||||
|       }) | ||||
|     return actions | ||||
|   } | ||||
|  | ||||
|   static $getCaracAction(comp, main) { | ||||
|     if (comp?.system.defaut_carac) { | ||||
|       return comp.system.defaut_carac | ||||
|     } | ||||
|     switch (main) { | ||||
|       case '(lancer)': return 'lancer' | ||||
|       case '(tir)': return 'tir' | ||||
|       default: return 'melee' | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   static $getCompetenceAction(arme, main) { | ||||
|     switch (main) { | ||||
|       case '(1 main)': return arme.competence1Mains() | ||||
|       case '(2 mains)': return arme.competence2Mains() | ||||
|       case '(lancer)': return arme.system.lancer | ||||
|       case '(tir)': return arme.system.tir | ||||
|       default: return arme.system.competence | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async $perteReveEnchantementsChateauDormants() { | ||||
|     const toUpdate = this.items.filter(it => [ITEM_TYPES.potion, ITEM_TYPES.gemme].includes(it.type)) | ||||
| @@ -323,7 +243,7 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|     } | ||||
|     await this.resetInfoSommeil() | ||||
|     ChatMessage.create(message); | ||||
|     setTimeout(() => this.sheet.render(), 20) | ||||
|     this.sheet.render(true); | ||||
|   } | ||||
|  | ||||
|   async _recuperationSante(message) { | ||||
| @@ -359,32 +279,28 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|   /* -------------------------------------------- */ | ||||
|   async dormirChateauDormant() { | ||||
|     if (!ReglesOptionnelles.isUsing("chateau-dormant-gardien") || !this.system.sommeil || this.system.sommeil.nouveaujour) { | ||||
|       await this.$dormirChateauDormant(); | ||||
|       setTimeout(() => this.sheet.render(), 20) | ||||
|     } | ||||
|   } | ||||
|       const message = { | ||||
|         whisper: ChatUtility.getOwners(this), | ||||
|         content: "" | ||||
|       }; | ||||
|  | ||||
|   async $dormirChateauDormant() { | ||||
|     const message = { | ||||
|       whisper: ChatUtility.getOwners(this), | ||||
|       content: "" | ||||
|     }; | ||||
|  | ||||
|     await this._recuperationSante(message); | ||||
|     await this._recupereMoralChateauDormant(message); | ||||
|     await this._recupereChance(); | ||||
|     await this.transformerStress(); | ||||
|     await this.retourSeuilDeReve(message); | ||||
|     await this.setBonusPotionSoin(0); | ||||
|     await this.retourSust(message); | ||||
|     await this.$perteReveEnchantementsChateauDormants(); | ||||
|     await this.$suppressionLancementsSort(); | ||||
|     await RdDCoeur.applyCoeurChateauDormant(this, message); | ||||
|     if (message.content != "") { | ||||
|       message.content = `A la fin Chateau Dormant, ${message.content}<br>Un nouveau jour se lève`; | ||||
|       ChatMessage.create(message); | ||||
|       await this._recuperationSante(message) | ||||
|       await this._recupereMoralChateauDormant(message) | ||||
|       await this._recupereChance() | ||||
|       await this.transformerStress() | ||||
|       await this.retourSeuilDeReve(message) | ||||
|       await this.setBonusPotionSoin(0) | ||||
|       await this.retourSust(message) | ||||
|       await this.$perteReveEnchantementsChateauDormants() | ||||
|       await this.$suppressionLancementsSort() | ||||
|       await RdDCoeur.applyCoeurChateauDormant(this, message) | ||||
|       if (message.content != "") { | ||||
|         message.content = `A la fin Chateau Dormant, ${message.content}<br>Un nouveau jour se lève`; | ||||
|         ChatMessage.create(message); | ||||
|       } | ||||
|       await this.resetInfoSommeil(); | ||||
|       this.sheet.render(true); | ||||
|     } | ||||
|     await this.resetInfoSommeil(); | ||||
|   } | ||||
|  | ||||
|   async resetInfoSommeil() { | ||||
| @@ -526,9 +442,10 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|       message.content += 'Vous ne trouvez pas le sommeil'; | ||||
|     } | ||||
|     else { | ||||
|       let dormi = await this.$dormirDesHeures(message, heures, options); | ||||
|       if (dormi.jetsReve.length > 0) { | ||||
|         message.content += `Vous récupérez ${dormi.jetsReve.map(it => it < 0 ? '0 (réveil)' : it).reduce(Misc.joining("+"))} Points de rêve. `; | ||||
|       let jetsReve = []; | ||||
|       let dormi = await this.dormirDesHeures(jetsReve, message, heures, options); | ||||
|       if (jetsReve.length > 0) { | ||||
|         message.content += `Vous récupérez ${jetsReve.map(it => it < 0 ? '0 (réveil)' : it).reduce(Misc.joining("+"))} Points de rêve. `; | ||||
|       } | ||||
|       if (dormi.etat == 'eveil') { | ||||
|         await this.reveilReveDeDragon(message, dormi.heures); | ||||
| @@ -541,9 +458,11 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|       ChatMessage.create(message); | ||||
|     } | ||||
|     if (options.chateauDormant) { | ||||
|       await this.$dormirChateauDormant(); | ||||
|       await this.dormirChateauDormant(); | ||||
|     } | ||||
|     else { | ||||
|       this.sheet.render(true); | ||||
|     } | ||||
|     setTimeout(() => this.sheet.render(), 20) | ||||
|   } | ||||
|  | ||||
|   async reveilReveDeDragon(message, heures) { | ||||
| @@ -553,18 +472,18 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   async $dormirDesHeures(message, heures, options) { | ||||
|     const dormi = { heures: 0, etat: 'dort', jetsReve: [] }; | ||||
|   async dormirDesHeures(jetsReve, message, heures, options) { | ||||
|     const dormi = { heures: 0, etat: 'dort' }; | ||||
|     for (; dormi.heures < heures && dormi.etat == 'dort'; dormi.heures++) { | ||||
|       await this.$recupererEthylisme(message); | ||||
|       await this._recupererEthylisme(message); | ||||
|       if (options.grisReve) { | ||||
|         await this.$recupererFatigue(message); | ||||
|         await this.recupererFatigue(message); | ||||
|       } | ||||
|       else if (!this.system.sommeil?.insomnie) { | ||||
|         await this.$recupererFatigue(message); | ||||
|         await this.$jetRecuperationReve(dormi, message); | ||||
|         await this.recupererFatigue(message); | ||||
|         dormi.etat = await this.jetRecuperationReve(jetsReve, message); | ||||
|         if (dormi.etat == 'dort' && EffetsDraconiques.isDonDoubleReve(this)) { | ||||
|           await this.$jetRecuperationReve(dormi, message); | ||||
|           dormi.etat = await this.jetRecuperationReve(jetsReve, message); | ||||
|         } | ||||
|       } | ||||
|     } | ||||
| @@ -572,36 +491,35 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async $jetRecuperationReve(dormi, message) { | ||||
|   async jetRecuperationReve(jetsReve, message) { | ||||
|     if (this.getReveActuel() < this.system.reve.seuil.value) { | ||||
|       const reve = await RdDDice.rollTotal("1dr") | ||||
|       let reve = await RdDDice.rollTotal("1dr"); | ||||
|       if (reve >= 7) { | ||||
|         // Rêve de Dragon ! | ||||
|         message.content += `Vous faites un <strong>Rêve de Dragon</strong> de ${reve} Points de rêve qui vous réveille! `; | ||||
|         await this.combattreReveDeDragon(reve); | ||||
|         dormi.jetsReve.push(-1); | ||||
|         dormi.etat = 'eveil' | ||||
|         return | ||||
|         jetsReve.push(-1); | ||||
|         return 'eveil'; | ||||
|       } | ||||
|       else { | ||||
|         if (!ReglesOptionnelles.isUsing("recuperation-reve")) { | ||||
|           ChatMessage.create({ | ||||
|             whisper: ChatUtility.getOwners(this), | ||||
|             content: `Pas de récupération de rêve (${reve} points ignorés)` | ||||
|           }) | ||||
|           dormi.jetsReve.push(0) | ||||
|           }); | ||||
|           jetsReve.push(0); | ||||
|         } | ||||
|         else { | ||||
|           await this.reveActuelIncDec(reve) | ||||
|           dormi.jetsReve.push(reve) | ||||
|           await this.reveActuelIncDec(reve); | ||||
|           jetsReve.push(reve); | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|     dormi.etat = 'dort' | ||||
|     return 'dort'; | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async $recupererEthylisme(message) { | ||||
|   async _recupererEthylisme(message) { | ||||
|     if (!ReglesOptionnelles.isUsing("recuperation-ethylisme")) { return; } | ||||
|     let value = Math.min(Number.parseInt(this.system.compteurs.ethylisme.value) + 1, 1); | ||||
|     if (value <= 0) { | ||||
| @@ -623,6 +541,7 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|       max = Math.floor(max / 2); | ||||
|     } | ||||
|     const manquant = max - this.system.sante.endurance.value; | ||||
|  | ||||
|     if (manquant > 0) { | ||||
|       await this.santeIncDec("endurance", manquant); | ||||
|       message.content += `Vous récuperez ${manquant} points d'endurance. `; | ||||
| @@ -630,15 +549,18 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async $recupererFatigue(message) { | ||||
|   async recupererFatigue(message) { | ||||
|     if (ReglesOptionnelles.isUsing("appliquer-fatigue")) { | ||||
|       let fatigue = this.system.sante.fatigue.value | ||||
|       const fatigueMin = this.getFatigueMin() | ||||
|       let fatigue = this.system.sante.fatigue.value; | ||||
|       const fatigueMin = this.getFatigueMin(); | ||||
|       if (fatigue <= fatigueMin) { | ||||
|         return | ||||
|         return; | ||||
|       } | ||||
|       fatigue = Math.max(fatigueMin, this._calculRecuperationSegment(fatigue)) | ||||
|       await this.update({ 'system.sante.fatigue.value': fatigue }); | ||||
|       fatigue = Math.max(fatigueMin, this._calculRecuperationSegment(fatigue)); | ||||
|       setTimeout( // On attend un peu pour que le message de récupération de r | ||||
|         async () => { | ||||
|           await this.update({ 'system.sante.fatigue.value': fatigue }); | ||||
|         }, 200); | ||||
|       if (fatigue == 0) { | ||||
|         message.content += "Vous êtes complêtement reposé. "; | ||||
|       } | ||||
| @@ -748,23 +670,19 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|     if (!RdDItemRace.checkRacialMax(this, caracName, to)) { | ||||
|       return | ||||
|     } | ||||
|     let updates = {}; | ||||
|     if (caracName == LIST_CARAC_PERSONNAGE.reve.code) { | ||||
|       if (to > Misc.toInt(this.system.reve.seuil.value)) { | ||||
|         updates[`system.reve.seuil.value`] = to; // SFA : Direct and packed changes | ||||
|         //this.setPointsDeSeuil(to); | ||||
|         this.setPointsDeSeuil(to); | ||||
|       } | ||||
|     } | ||||
|     if (caracName == LIST_CARAC_PERSONNAGE.chance.code) { | ||||
|       if (to > Misc.toInt(this.system.compteurs.chance.value)) { | ||||
|         updates[`system.compteurs.chance.value`] = to; // SFA : Direct and packed changes | ||||
|         //this.setPointsDeChance(to); | ||||
|         this.setPointsDeChance(to); | ||||
|       } | ||||
|     } | ||||
|     let selectedCarac = this.findCaracByName(caracName); | ||||
|     const from = selectedCarac.value | ||||
|     updates[`system.carac.${caracName}.value`] = to; | ||||
|     await this.update(updates); | ||||
|     await this.update({ [`system.carac.${caracName}.value`]: to }); | ||||
|     await ExperienceLog.add(this, XP_TOPIC.CARAC, from, to, caracName); | ||||
|   } | ||||
|  | ||||
| @@ -868,7 +786,7 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|       const toNiveau = compValue ?? RdDItemCompetence.getNiveauBase(competence.system.categorie, competence.getCategories()); | ||||
|       this.notifyCompetencesTronc(competence, toNiveau); | ||||
|       const fromNiveau = competence.system.niveau; | ||||
|       await competence.update({ 'system.niveau': toNiveau }, { render: true }) | ||||
|       await competence.update({ 'system.niveau': toNiveau }, { render: false }) | ||||
|       await ExperienceLog.add(this, XP_TOPIC.NIVEAU, fromNiveau, toNiveau, competence.name, true); | ||||
|     } | ||||
|   } | ||||
| @@ -975,14 +893,8 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   ethylisme() { | ||||
|     return this.system.compteurs.ethylisme?.value ?? 1; | ||||
|   } | ||||
|   malusEthylisme() { | ||||
|     return Math.min(0, this.ethylisme()) | ||||
|   } | ||||
|   isAlcoolise() { | ||||
|     return this.ethylisme() < 1 | ||||
|     return Math.min(0, (this.system.compteurs.ethylisme?.value ?? 0)); | ||||
|   } | ||||
|  | ||||
|  | ||||
| @@ -1138,10 +1050,20 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async deleteRencontreTMRAtPosition() { | ||||
|     const rencontreIds = this.itemTypes[ITEM_TYPES.rencontre].filter(this.filterRencontreTMRDemiReve()).map(it => it.id) | ||||
|     if (rencontreIds.length > 0) { | ||||
|       await this.deleteEmbeddedDocuments('Item', rencontreIds) | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   getRencontreTMREnAttente() { | ||||
|     return this.itemTypes[ITEM_TYPES.rencontre].find(this.filterRencontreTMRDemiReve()) | ||||
|   } | ||||
|  | ||||
|   filterRencontreTMRDemiReve() { | ||||
|     const position = this.getDemiReve() | ||||
|     return this.itemTypes[ITEM_TYPES.rencontre].find(it => it.system.coord == position) | ||||
|     return it => it.system.coord == position | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
| @@ -1568,7 +1490,7 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|   /* -------------------------------------------- */ | ||||
|   createCallbackAppelAuMoral() { /* Si l'appel au moral est utilisé, on l'affiche dans le chat et on diminue éventuellement le moral */ | ||||
|     return { | ||||
|       action: r => this.appliquerAppelMoral(r) | ||||
|       action: r => this._appliquerAppelMoral(r) | ||||
|     }; | ||||
|   } | ||||
|  | ||||
| @@ -1664,12 +1586,12 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async appliquerAppelMoral(rollData) { | ||||
|   async _appliquerAppelMoral(rollData) { | ||||
|     if (!rollData.use.moral || game.settings.get("core", "rollMode") == 'selfroll') { | ||||
|       return | ||||
|     } | ||||
|     if (rollData.rolled.isEchec || | ||||
|       (rollData.diviseurSignificative && (rollData.rolled.roll * rollData.diviseurSignificative > rollData.rolled.score))) { | ||||
|       (rollData.ajustements.diviseurSignificative && (rollData.rolled.roll * rollData.ajustements.diviseurSignificative > rollData.score))) { | ||||
|       rollData.perteMoralEchec = rollData.moral <= -3 ? 'dissolution' : 'perte'; | ||||
|       rollData.moral = await this.moralIncDec(-1); /* L'appel au moral a échoué. Le personnage perd un point de moral */ | ||||
|     } | ||||
| @@ -1677,7 +1599,20 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   $filterSortList(sortList, coord) { | ||||
|     return sortList.filter(it => RdDItemSort.isSortOnCoord(it, coord)) | ||||
|     let tmr = TMRUtility.getTMR(coord); | ||||
|     let filtered = [] | ||||
|     for (let sort of sortList) { | ||||
|       if (sort.system.caseTMR.toLowerCase().includes('variable')) { | ||||
|         filtered.push(sort); | ||||
|       } else if (sort.system.caseTMRspeciale.toLowerCase().includes('variable')) { | ||||
|         filtered.push(sort); | ||||
|       } else if (sort.system.caseTMR.toLowerCase() == tmr.type) { | ||||
|         filtered.push(sort); | ||||
|       } else if (sort.system.caseTMR.toLowerCase().includes('special') && sort.system.caseTMRspeciale.toLowerCase().includes(coord.toLowerCase())) { | ||||
|         filtered.push(sort); | ||||
|       } | ||||
|     } | ||||
|     return filtered; | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
| @@ -1703,8 +1638,8 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|       ui.notifications.error("Une queue ou un souffle vous empèche de lancer de sort!") | ||||
|       return | ||||
|     } | ||||
|     // Duplication car les pts de reve sont modifiés dans le sort! | ||||
|     let sorts = foundry.utils.duplicate(this.itemTypes[ITEM_TYPES.sort].filter(it => RdDItemSort.isSortOnCoord(it, coord))) | ||||
|     // Duplication car les pts de reve sont modifiés dans le sort | ||||
|     let sorts = foundry.utils.duplicate(this.$filterSortList(this.itemTypes['sort'], coord)); | ||||
|     if (sorts.length == 0) { | ||||
|       ui.notifications.info(`Aucun sort disponible en ${TMRUtility.getTMR(coord).label} !`); | ||||
|       return; | ||||
| @@ -1838,7 +1773,7 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|     if (reveActuel == 0) { // 0 points de reve | ||||
|       ChatMessage.create({ content: this.name + " est réduit à 0 Points de Rêve, et tombe endormi !" }); | ||||
|     } | ||||
|     if (!rollData.isSortReserve || !rolled.isSuccess) { | ||||
|     if (!rollData.isSortReserve) { | ||||
|       this.tmrApp?.close(); | ||||
|     } | ||||
|   } | ||||
| @@ -1868,8 +1803,10 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|     }; | ||||
|     RollDataAjustements.calcul(rollData, this); | ||||
|     await RdDResolutionTable.rollData(rollData); | ||||
|     this.gererExperience(rollData); | ||||
|     await RdDRollResult.displayRollData(rollData, this) | ||||
|  | ||||
|     this.gererExperience(rollData); | ||||
|  | ||||
|     return rollData.rolled; | ||||
|   } | ||||
|  | ||||
| @@ -1992,6 +1929,153 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async _rollArt(artData, selected, oeuvre, callbackAction = async r => await this._resultArt(r)) { | ||||
|     oeuvre.system.niveau = oeuvre.system.niveau ?? 0; | ||||
|     foundry.utils.mergeObject(artData, | ||||
|       { | ||||
|         oeuvre: oeuvre, | ||||
|         art: oeuvre.type, | ||||
|         competence: foundry.utils.duplicate(this.getCompetence(artData.compName ?? oeuvre.system.competence ?? artData.art)), | ||||
|         diffLibre: - oeuvre.system.niveau, | ||||
|         diffConditions: 0, | ||||
|         use: { libre: false, conditions: true, surenc: false }, | ||||
|         selectedCarac: foundry.utils.duplicate(this.system.carac[selected]) | ||||
|       }, | ||||
|       { overwrite: false }); | ||||
|     artData.competence.system.defaut_carac = selected; | ||||
|     if (!artData.forceCarac) { | ||||
|       artData.forceCarac = {}; | ||||
|       artData.forceCarac[selected] = foundry.utils.duplicate(this.system.carac[selected]); | ||||
|     } | ||||
|  | ||||
|     await this.openRollDialog({ | ||||
|       name: `jet-${artData.art}`, | ||||
|       label: `${artData.verbe} ${oeuvre.name}`, | ||||
|       template: `systems/foundryvtt-reve-de-dragon/templates/dialog-roll-${oeuvre.type}.hbs`, | ||||
|       rollData: artData, | ||||
|       callbacks: [{ action: callbackAction }], | ||||
|     }) | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async _resultArt(artData) { | ||||
|     const niveau = artData.oeuvre.system.niveau ?? 0; | ||||
|     const baseQualite = (artData.rolled.isSuccess ? niveau : artData.competence.system.niveau); | ||||
|     artData.qualiteFinale = Math.min(baseQualite, niveau) + artData.rolled.ptQualite; | ||||
|  | ||||
|     await RdDRollResult.displayRollData(artData, this.name, `chat-resultat-${artData.art}.hbs`); | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async rollChant(id) { | ||||
|     const artData = { art: 'chant', verbe: 'Chanter' }; | ||||
|     const oeuvre = foundry.utils.duplicate(this.getChant(id)); | ||||
|     await this._rollArt(artData, "ouie", oeuvre); | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async rollDanse(id) { | ||||
|     const artData = { art: 'danse', verbe: 'Danser', forceCarac: {} }; | ||||
|     const oeuvre = foundry.utils.duplicate(this.findItemLike(id, artData.art)); | ||||
|     if (oeuvre.system.agilite) { | ||||
|       artData.forceCarac['agilite'] = foundry.utils.duplicate(this.system.carac.agilite); | ||||
|     } | ||||
|     if (oeuvre.system.apparence) { | ||||
|       artData.forceCarac['apparence'] = foundry.utils.duplicate(this.system.carac.apparence); | ||||
|     } | ||||
|     const selectedCarac = this._getCaracDanse(oeuvre); | ||||
|     await this._rollArt(artData, selectedCarac, oeuvre); | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   _getCaracDanse(oeuvre) { | ||||
|     if (oeuvre.system.agilite) { return "agilite"; } | ||||
|     else if (oeuvre.system.apparence) { return "apparence"; } | ||||
|     const compData = this.getCompetence(oeuvre.system.competence); | ||||
|     return compData.system.defaut_carac; | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async rollMusique(id) { | ||||
|     const artData = { art: 'musique', verbe: 'Jouer' }; | ||||
|     const oeuvre = this.findItemLike(id, artData.art); | ||||
|     await this._rollArt(artData, "ouie", oeuvre); | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async rollRecetteCuisine(id) { | ||||
|     const oeuvre = this.getRecetteCuisine(id); | ||||
|     const artData = { | ||||
|       verbe: 'Cuisiner', | ||||
|       compName: 'cuisine', | ||||
|       proportions: 1, | ||||
|       ajouterEquipement: false | ||||
|     }; | ||||
|     await this._rollArt(artData, 'odoratgout', oeuvre, r => this._resultRecetteCuisine(r)); | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async _resultRecetteCuisine(cuisine) { | ||||
|     const niveauRecette = cuisine.oeuvre.system.niveau ?? 0; | ||||
|     const baseQualite = (cuisine.rolled.isSuccess ? niveauRecette : cuisine.competence.system.niveau); | ||||
|     cuisine.qualiteFinale = Math.min(baseQualite, niveauRecette) + cuisine.rolled.ptQualite; | ||||
|     cuisine.exotismeFinal = Math.min(Math.min(cuisine.qualiteFinale, cuisine.oeuvre.system.exotisme ?? 0), 0); | ||||
|     cuisine.sust = cuisine.oeuvre.system.sust * Math.min(cuisine.proportions, cuisine.proportionsMax ?? cuisine.proportions) | ||||
|     const platCuisine = { | ||||
|       name: cuisine.oeuvre.name, | ||||
|       type: 'nourritureboisson', | ||||
|       img: 'systems/foundryvtt-reve-de-dragon/icons/objets/provision_cuite.webp', | ||||
|       system: { | ||||
|         "description": cuisine.oeuvre.system.description, | ||||
|         "sust": 1, | ||||
|         "qualite": cuisine.qualiteFinale, | ||||
|         "exotisme": cuisine.exotismeFinal, | ||||
|         "encombrement": 0.1, | ||||
|         "quantite": Math.max(1, Math.floor(cuisine.sust)), | ||||
|         "cout": Math.max(cuisine.qualiteFinale) * 0.01 | ||||
|       } | ||||
|     } | ||||
|     if (cuisine.ajouterEquipement) { | ||||
|       await this.createEmbeddedDocuments('Item', [platCuisine]); | ||||
|       ui.notifications.info(`${platCuisine.system.quantite} rations de ${platCuisine.name} ont été ajoutés à votre équipement`); | ||||
|     } | ||||
|     cuisine.platCuisine = platCuisine; | ||||
|     await RdDRollResult.displayRollData(cuisine, this.name, `chat-resultat-${cuisine.art}.hbs`); | ||||
|   } | ||||
|  | ||||
|   async preparerNourriture(item) { | ||||
|     if (item.getUtilisationCuisine() == 'brut') { | ||||
|       const nourriture = { | ||||
|         name: 'Plat de ' + item.name, | ||||
|         type: 'recettecuisine', | ||||
|         img: item.img, | ||||
|         system: { | ||||
|           sust: item.system.sust, | ||||
|           exotisme: item.system.exotisme, | ||||
|           ingredients: item.name | ||||
|         } | ||||
|       }; | ||||
|       const artData = { | ||||
|         verbe: 'Préparer', | ||||
|         compName: 'cuisine', | ||||
|         proportions: 1, | ||||
|         proportionsMax: Math.min(50, item.system.quantite), | ||||
|         ajouterEquipement: true | ||||
|       }; | ||||
|       await this._rollArt(artData, 'odoratgout', nourriture, async (cuisine) => { | ||||
|         await this._resultRecetteCuisine(cuisine); | ||||
|         const remaining = Math.max(item.system.quantite - cuisine.proportions, 0); | ||||
|         if (remaining > 0) { | ||||
|           await item.update({ 'system.quantite': remaining }) | ||||
|         } | ||||
|         else { | ||||
|           await this.deleteEmbeddedDocuments('Item', [item.id]); | ||||
|         } | ||||
|       }); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async rollJeu(id) { | ||||
|     const oeuvre = this.getJeu(id); | ||||
| @@ -2007,9 +2091,14 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|     listCarac.forEach(c => artData.forceCarac[c] = this.system.carac[c]); | ||||
|     artData.competence.system.niveauReel = artData.competence.system.niveau; | ||||
|     artData.competence.system.niveau = Math.max(artData.competence.system.niveau, oeuvre.system.base); | ||||
|     await this._rollArtV1(artData, carac, oeuvre); | ||||
|     await this._rollArt(artData, carac, oeuvre); | ||||
|   } | ||||
|  | ||||
|   async rollOeuvre(id) { | ||||
|     const artData = { art: 'oeuvre', verbe: 'Interpréter' } | ||||
|     const oeuvre = foundry.utils.duplicate(this.findItemLike(id, artData.art)) | ||||
|     await this._rollArt(artData, oeuvre.system.default_carac, oeuvre) | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async rollMeditation(id) { | ||||
| @@ -2032,6 +2121,7 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|         label: "Jet de méditation", | ||||
|         callbacks: [ | ||||
|           this.createCallbackExperience(), | ||||
|           { condition: r => r.rolled.isEPart, action: r => this._meditationEPart(r) }, | ||||
|           { action: r => this._meditationResult(r) } | ||||
|         ] | ||||
|       }); | ||||
| @@ -2040,16 +2130,21 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async _meditationResult(meditationRoll) { | ||||
|     this.santeIncDec("fatigue", 2); | ||||
|  | ||||
|     if (meditationRoll.rolled.isSuccess) { | ||||
|       await this.createEmbeddedDocuments("Item", [RdDItemSigneDraconique.prepareSigneDraconiqueMeditation(meditationRoll.meditation, meditationRoll.rolled)]); | ||||
|     } | ||||
|     if (meditationRoll.rolled.isEPart) { | ||||
|       await this.updateEmbeddedDocuments('Item', [{ _id: meditationRoll.meditation._id, 'system.malus': meditationRoll.meditation.system.malus - 1 }]); | ||||
|     } | ||||
|     await this.santeIncDec("fatigue", 2); | ||||
|  | ||||
|     await RdDRollResult.displayRollData(meditationRoll, this.name, 'chat-resultat-meditation.hbs'); | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   _meditationEPart(meditationRoll) { | ||||
|     this.updateEmbeddedDocuments('Item', [{ _id: meditationRoll.meditation._id, 'system.malus': meditationRoll.meditation.system.malus - 1 }]); | ||||
|   } | ||||
|  | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   _getSignesDraconiques(coord) { | ||||
|     const type = TMRUtility.getTMRType(coord); | ||||
| @@ -2353,7 +2448,7 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|       this.tmrApp.forceTMRDisplay() | ||||
|       return | ||||
|     } | ||||
|     if (mode != 'visu' && this.isDemiReve()) { | ||||
|     if (mode != 'visu' && this.getEffect(STATUSES.StatusDemiReve)) { | ||||
|       ui.notifications.warn("Les personnage est déjà dans les Terres Médianes, elles s'affichent en visualisation") | ||||
|       mode = "visu"; // bascule le mode en visu automatiquement | ||||
|     } | ||||
| @@ -2633,11 +2728,8 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|  | ||||
|   listeSuivants(filter = suivant => true) { | ||||
|     return RdDActor.$buildSubActorLinks( | ||||
|       this.system.subacteurs.suivants, RdDActor.$transformSubActeurSuivant | ||||
|     ).filter(filter) | ||||
|   } | ||||
|   listeAmoureux() { | ||||
|     return this.listeSuivants(it => it.coeur > 0 && it.type == ACTOR_TYPES.personnage) | ||||
|       this.system.subacteurs.suivants.filter(filter), RdDActor.$transformSubActeurSuivant | ||||
|     ) | ||||
|   } | ||||
|  | ||||
|   getSuivant(subActorId) { | ||||
| @@ -3047,205 +3139,5 @@ export class RdDActor extends RdDBaseActorSang { | ||||
|     await incarnation.remiseANeuf(); | ||||
|     incarnation.sheet.render(true); | ||||
|   } | ||||
|  | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async _rollArtV2(oeuvreId, callbackAction = async (actor, rd) => await actor._resultArtV2(rd)) { | ||||
|     const oeuvre = this.items.get(oeuvreId) | ||||
|     const rollData = { | ||||
|       title: `Interpretation de ${oeuvre.name} par ${this.name}`, | ||||
|       mode: { | ||||
|         allowed: ["oeuvre"] | ||||
|       }, | ||||
|       selected: { | ||||
|         mode: "oeuvre", | ||||
|         oeuvre: { key: oeuvre.id }, | ||||
|       }, | ||||
|       ids: { | ||||
|         actorId: this.id | ||||
|       } | ||||
|     } | ||||
|     await RollDialog.create(rollData, { | ||||
|       onRoll: (dialog) => { | ||||
|         this._onCloseRollDialog(), | ||||
|           dialog.close() | ||||
|       }, | ||||
|       customChatMessage: true, | ||||
|       callbacks: [callbackAction] | ||||
|     }) | ||||
|   } | ||||
|  | ||||
|   async _resultArtV2(artData) { | ||||
|     const niveau = artData.oeuvre.system.niveau ?? 0; | ||||
|     const baseQualite = (artData.rolled.isSuccess ? niveau : artData.competence.system.niveau); | ||||
|     artData.qualiteFinale = Math.min(baseQualite, niveau) + artData.rolled.ptQualite; | ||||
|  | ||||
|     await RdDRollResult.displayRollData(artData, this.name, `chat-resultat-${artData.art}.hbs`); | ||||
|   } | ||||
|   /* -------------------------------------------- */ | ||||
|  | ||||
|   async rollOeuvre(id) { | ||||
|     if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) { | ||||
|       return await this._rollArtV2(id) | ||||
|     } | ||||
|     else { | ||||
|       const artData = { art: 'oeuvre', verbe: 'Interpréter' } | ||||
|       const oeuvre = foundry.utils.duplicate(this.findItemLike(id, artData.art)) | ||||
|       await this._rollArtV1(artData, oeuvre.system.default_carac, oeuvre) | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   async rollChant(id) { | ||||
|     if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) { | ||||
|       await this._rollArtV2(id) | ||||
|     } | ||||
|     else { | ||||
|       const artData = { art: 'chant', verbe: 'Chanter' } | ||||
|       const oeuvre = foundry.utils.duplicate(this.getChant(id)) | ||||
|       await this._rollArtV1(artData, "ouie", oeuvre) | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   async rollDanse(id) { | ||||
|     if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) { | ||||
|       await this._rollArtV2(id) | ||||
|     } | ||||
|     else { | ||||
|       const artData = { art: 'danse', verbe: 'Danser', forceCarac: {} } | ||||
|       const oeuvre = foundry.utils.duplicate(this.findItemLike(id, artData.art)) | ||||
|       let selectedCarac = this.getCompetence(oeuvre.system.competence)?.system.defaut_carac | ||||
|       if (oeuvre.system.apparence) { | ||||
|         artData.forceCarac['apparence'] = foundry.utils.duplicate(this.system.carac.apparence) | ||||
|         selectedCarac = "apparence" | ||||
|       } | ||||
|       if (oeuvre.system.agilite) { | ||||
|         artData.forceCarac['agilite'] = foundry.utils.duplicate(this.system.carac.agilite) | ||||
|         selectedCarac = "agilite" | ||||
|       } | ||||
|       await this._rollArtV1(artData, selectedCarac, oeuvre) | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   async rollMusique(id) { | ||||
|     if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) { | ||||
|       await this._rollArtV2(id) | ||||
|     } | ||||
|     else { | ||||
|       const artData = { art: 'musique', verbe: 'Jouer' } | ||||
|       const oeuvre = this.findItemLike(id, artData.art) | ||||
|       await this._rollArtV1(artData, "ouie", oeuvre) | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async _rollArtV1(artData, selected, oeuvre, callbackAction = async r => await this._resultArt(r)) { | ||||
|     oeuvre.system.niveau = oeuvre.system.niveau ?? 0; | ||||
|     foundry.utils.mergeObject(artData, | ||||
|       { | ||||
|         oeuvre: oeuvre, | ||||
|         art: oeuvre.type, | ||||
|         competence: foundry.utils.duplicate(this.getCompetence(artData.compName ?? oeuvre.system.competence ?? artData.art)), | ||||
|         diffLibre: - oeuvre.system.niveau, | ||||
|         diffConditions: 0, | ||||
|         use: { libre: false, conditions: true, surenc: false }, | ||||
|         selectedCarac: foundry.utils.duplicate(this.system.carac[selected]) | ||||
|       }, | ||||
|       { overwrite: false }); | ||||
|     artData.competence.system.defaut_carac = selected; | ||||
|     if (!artData.forceCarac) { | ||||
|       artData.forceCarac = {}; | ||||
|       artData.forceCarac[selected] = foundry.utils.duplicate(this.system.carac[selected]); | ||||
|     } | ||||
|  | ||||
|     await this.openRollDialog({ | ||||
|       name: `jet-${artData.art}`, | ||||
|       label: `${artData.verbe} ${oeuvre.name}`, | ||||
|       template: `systems/foundryvtt-reve-de-dragon/templates/dialog-roll-${oeuvre.type}.hbs`, | ||||
|       rollData: artData, | ||||
|       callbacks: [{ action: callbackAction }], | ||||
|     }) | ||||
|   } | ||||
|  | ||||
|   async _resultArt(artData) { | ||||
|     const niveau = artData.oeuvre.system.niveau ?? 0; | ||||
|     const baseQualite = (artData.rolled.isSuccess ? niveau : artData.competence.system.niveau); | ||||
|     artData.qualiteFinale = Math.min(baseQualite, niveau) + artData.rolled.ptQualite; | ||||
|  | ||||
|     await RdDRollResult.displayRollData(artData, this.name, `chat-resultat-${artData.art}.hbs`); | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async rollRecetteCuisine(id) { | ||||
|     const oeuvre = this.getRecetteCuisine(id); | ||||
|     const artData = { | ||||
|       verbe: 'Cuisiner', | ||||
|       compName: 'cuisine', | ||||
|       proportions: 1, | ||||
|       ajouterEquipement: false | ||||
|     }; | ||||
|     await this._rollArtV1(artData, 'odoratgout', oeuvre, r => this._resultRecetteCuisine(r)); | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async _resultRecetteCuisine(cuisine) { | ||||
|     const niveauRecette = cuisine.oeuvre.system.niveau ?? 0; | ||||
|     const baseQualite = (cuisine.rolled.isSuccess ? niveauRecette : cuisine.competence.system.niveau); | ||||
|     cuisine.qualiteFinale = Math.min(baseQualite, niveauRecette) + cuisine.rolled.ptQualite; | ||||
|     cuisine.exotismeFinal = Math.min(Math.min(cuisine.qualiteFinale, cuisine.oeuvre.system.exotisme ?? 0), 0); | ||||
|     cuisine.sust = cuisine.oeuvre.system.sust * Math.min(cuisine.proportions, cuisine.proportionsMax ?? cuisine.proportions) | ||||
|     const platCuisine = { | ||||
|       name: cuisine.oeuvre.name, | ||||
|       type: 'nourritureboisson', | ||||
|       img: 'systems/foundryvtt-reve-de-dragon/icons/objets/provision_cuite.webp', | ||||
|       system: { | ||||
|         "description": cuisine.oeuvre.system.description, | ||||
|         "sust": 1, | ||||
|         "qualite": cuisine.qualiteFinale, | ||||
|         "exotisme": cuisine.exotismeFinal, | ||||
|         "encombrement": 0.1, | ||||
|         "quantite": Math.max(1, Math.floor(cuisine.sust)), | ||||
|         "cout": Math.max(cuisine.qualiteFinale) * 0.01 | ||||
|       } | ||||
|     } | ||||
|     if (cuisine.ajouterEquipement) { | ||||
|       await this.createEmbeddedDocuments('Item', [platCuisine]); | ||||
|       ui.notifications.info(`${platCuisine.system.quantite} rations de ${platCuisine.name} ont été ajoutés à votre équipement`); | ||||
|     } | ||||
|     cuisine.platCuisine = platCuisine; | ||||
|     await RdDRollResult.displayRollData(cuisine, this.name, `chat-resultat-${cuisine.art}.hbs`); | ||||
|   } | ||||
|  | ||||
|   async preparerNourriture(item) { | ||||
|     if (item.getUtilisationCuisine() == 'brut') { | ||||
|       const nourriture = { | ||||
|         name: 'Plat de ' + item.name, | ||||
|         type: 'recettecuisine', | ||||
|         img: item.img, | ||||
|         system: { | ||||
|           sust: item.system.sust, | ||||
|           exotisme: item.system.exotisme, | ||||
|           ingredients: item.name | ||||
|         } | ||||
|       }; | ||||
|       const artData = { | ||||
|         verbe: 'Préparer', | ||||
|         compName: 'cuisine', | ||||
|         proportions: 1, | ||||
|         proportionsMax: Math.min(50, item.system.quantite), | ||||
|         ajouterEquipement: true | ||||
|       }; | ||||
|       await this._rollArtV1(artData, 'odoratgout', nourriture, async (cuisine) => { | ||||
|         await this._resultRecetteCuisine(cuisine); | ||||
|         const remaining = Math.max(item.system.quantite - cuisine.proportions, 0); | ||||
|         if (remaining > 0) { | ||||
|           await item.update({ 'system.quantite': remaining }) | ||||
|         } | ||||
|         else { | ||||
|           await this.deleteEmbeddedDocuments('Item', [item.id]); | ||||
|         } | ||||
|       }); | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -8,16 +8,15 @@ import { RdDUtility } from "../rdd-utility.js"; | ||||
| import { ReglesOptionnelles } from "../settings/regles-optionnelles.js"; | ||||
| import { RdDBaseActor } from "./base-actor.js"; | ||||
| import { ITEM_TYPES } from "../constants.js"; | ||||
| import { StatusEffects, STATUSES } from "../settings/status-effects.js"; | ||||
| import { RdDItemCompetence } from "../item-competence.js"; | ||||
| import { RdDItemCompetenceCreature } from "../item-competencecreature.js"; | ||||
| import { RdDItemArme } from "../item-arme.js"; | ||||
| 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 { RdDItemCompetence } from "../item-competence.js"; | ||||
| import { RdDItemCompetenceCreature } from "../item-competencecreature.js"; | ||||
| import { RdDItemArme } from "../item/arme.js"; | ||||
|  | ||||
| import { ChatUtility } from "../chat-utility.js"; | ||||
| import { DialogValidationEncaissement } from "../dialog-validation-encaissement.js"; | ||||
| import { RdDCombat } from "../rdd-combat.js"; | ||||
| @@ -80,7 +79,6 @@ export class RdDBaseActorReve extends RdDBaseActor { | ||||
|   getBonusDegat() { return RdDCarac.getCaracDerivee(this.getEncombrementMax()).plusdom } | ||||
|  | ||||
|   getMoralTotal() { return 0 } | ||||
|   listeAmoureux() {return []} | ||||
|   getProtectionNaturelle() { return Number(this.system.attributs?.protection?.value ?? 0) } | ||||
|   getSConst() { return 0 } | ||||
|  | ||||
| @@ -110,11 +108,10 @@ export class RdDBaseActorReve extends RdDBaseActor { | ||||
|     } | ||||
|     return this.system.carac[competence.system.defaut_carac].value; | ||||
|   } | ||||
|  | ||||
|   listActions({ isAttaque = false, isEquipe = false }) { | ||||
|   listActionsCombat() { | ||||
|     return this.itemTypes[ITEM_TYPES.competencecreature] | ||||
|       .filter(it => RdDItemCompetenceCreature.isAttaque(it)) | ||||
|       .map(it => RdDItemCompetenceCreature.attaqueCreature(it)) | ||||
|       .map(it => RdDItemCompetenceCreature.armeCreature(it)) | ||||
|       .filter(it => it != undefined); | ||||
|   } | ||||
|  | ||||
| @@ -167,16 +164,11 @@ export class RdDBaseActorReve extends RdDBaseActor { | ||||
|     if (idOrName instanceof Item) { | ||||
|       return idOrName.isCompetence() ? idOrName : undefined | ||||
|     } | ||||
|     return RdDItemCompetence.findCompetence( | ||||
|       this.items.filter(it => [ITEM_TYPES.competence, ITEM_TYPES.competencecreature].includes(it.type)), | ||||
|       idOrName, options) | ||||
|     return RdDItemCompetence.findCompetence(this.items, idOrName, options) | ||||
|   } | ||||
|  | ||||
|   getCompetences(name = undefined, options = { onMessage: message => { } }) { | ||||
|     if (name == undefined) { | ||||
|       return this.itemTypes[ITEM_TYPES.competence] | ||||
|     } | ||||
|     return RdDItemCompetence.findCompetences(this.itemTypes[ITEM_TYPES.competence], name, options) | ||||
|   getCompetences(name, options = { onMessage: message => { } }) { | ||||
|     return RdDItemCompetence.findCompetences(this.items, name, options) | ||||
|   } | ||||
|  | ||||
|   getCompetenceCorpsACorps(options = { onMessage: message => { } }) { | ||||
| @@ -226,24 +218,27 @@ export class RdDBaseActorReve extends RdDBaseActor { | ||||
|     return this.getEmbeddedCollection("ActiveEffect").filter(filter); | ||||
|   } | ||||
|  | ||||
|   getEffectByStatus(statusId) { | ||||
|     return this.getEffects().find(it => it.statuses.has(statusId)); | ||||
|   getEffect(effectId) { | ||||
|     return this.getEmbeddedCollection("ActiveEffect").find(it => it.statuses?.has(effectId)); | ||||
|   } | ||||
|  | ||||
|   async setEffect(statusId, status) { | ||||
|     if (this.isEffectAllowed(statusId)) { | ||||
|       const effect = this.getEffectByStatus(statusId); | ||||
|   async setEffect(effectId, status) { | ||||
|     if (this.isEffectAllowed(effectId)) { | ||||
|       const effect = this.getEffect(effectId); | ||||
|       if (!status && effect) { | ||||
|         await this.deleteEmbeddedDocuments('ActiveEffect', [effect.id]); | ||||
|       } | ||||
|       if (status && !effect) { | ||||
|         await this.createEmbeddedDocuments("ActiveEffect", [StatusEffects.prepareActiveEffect(statusId)]); | ||||
|         await this.createEmbeddedDocuments("ActiveEffect", [StatusEffects.prepareActiveEffect(effectId)]); | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   async removeEffect(id) { | ||||
|     this.removeEffects(it => it.id == id) | ||||
|     const effect = this.getEmbeddedCollection("ActiveEffect").find(it => it.id == id); | ||||
|     if (effect) { | ||||
|       await this.deleteEmbeddedDocuments('ActiveEffect', [id]); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   async removeEffects(filter = e => true) { | ||||
| @@ -254,16 +249,17 @@ export class RdDBaseActorReve extends RdDBaseActor { | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   isDemiReve() { | ||||
|     return this.getEffectByStatus(STATUSES.StatusDemiReve) != undefined | ||||
|   } | ||||
|  | ||||
|   getSurprise(isCombat = undefined) { | ||||
|     return StatusEffects.typeSurprise( | ||||
|       this.getEffects() | ||||
|         .map(it => StatusEffects.niveauSurprise(it, isCombat)) | ||||
|         .reduce(Misc.sum(), 0) | ||||
|     ) | ||||
|     let niveauSurprise = this.getEffects() | ||||
|       .map(effect => StatusEffects.valeurSurprise(effect, isCombat)) | ||||
|       .reduce(Misc.sum(), 0); | ||||
|     if (niveauSurprise > 1) { | ||||
|       return 'totale'; | ||||
|     } | ||||
|     if (niveauSurprise == 1) { | ||||
|       return 'demi'; | ||||
|     } | ||||
|     return ''; | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
| @@ -281,20 +277,8 @@ export class RdDBaseActorReve extends RdDBaseActor { | ||||
|     return dialog | ||||
|   } | ||||
|  | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   createCallbackExperience() { | ||||
|     return { action: r => this.appliquerAjoutExperience(r) } | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   createCallbackAppelAuMoral() { | ||||
|     /* Si l'appel au moral est utilisé, on l'affiche dans le chat et on diminue éventuellement le moral */ | ||||
|     return { action: r => this.appliquerAppelMoral(r) } | ||||
|   } | ||||
|  | ||||
|   async appliquerAjoutExperience(rollData, hideChatMessage = 'show') { } | ||||
|   async appliquerAppelMoral(rollData) { } | ||||
|   createCallbackExperience() { return { action: r => { } } } | ||||
|   createCallbackAppelAuMoral() { return { action: r => { } } } | ||||
|  | ||||
|   async _onCloseRollDialog(html) { } | ||||
|  | ||||
| @@ -357,9 +341,6 @@ export class RdDBaseActorReve extends RdDBaseActor { | ||||
|     const selectedCaracName = ['apparence', 'perception', 'force', 'reve'].find(it => carac[it] != undefined) | ||||
|  | ||||
|     await this.openRollDialog({ | ||||
|       name: 'jet-quelconque', | ||||
|       label: 'Jet', | ||||
|       template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll.hbs', | ||||
|       rollData: { | ||||
|         alias: this.getAlias(), | ||||
|         carac: carac, | ||||
| @@ -449,9 +430,9 @@ export class RdDBaseActorReve extends RdDBaseActor { | ||||
|    * @param {*} categorieArme catégorie d'attaque à utiliser: competence (== melee), lancer, tir; naturelle, possession | ||||
|    * @returns  | ||||
|    */ | ||||
|   rollArme(arme, categorieArme = 'competence', token = undefined) { | ||||
|   rollArme(arme, categorieArme, token) { | ||||
|     token = token ?? RdDUtility.getSelectedToken(this) | ||||
|     const compToUse = RdDItemArme.getCompetenceArme(arme, categorieArme) | ||||
|     const compToUse = this.$getCompetenceArme(arme, categorieArme) | ||||
|     if (!RdDItemArme.isUtilisable(arme)) { | ||||
|       ui.notifications.warn(`Arme inutilisable: ${arme.name} a une résistance de 0 ou moins`) | ||||
|       return | ||||
| @@ -485,6 +466,10 @@ export class RdDBaseActorReve extends RdDBaseActor { | ||||
|     }) | ||||
|   } | ||||
|  | ||||
|   $getCompetenceArme(arme, competenceName) { | ||||
|     return RdDItemArme.getCompetenceArme(arme, competenceName) | ||||
|   } | ||||
|  | ||||
|   verifierForceMin(item) { } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   | ||||
| @@ -39,12 +39,7 @@ export class RdDBaseActorSang extends RdDBaseActorReve { | ||||
|     return 0; | ||||
|   } | ||||
|  | ||||
|   isCumulFatigueCauseSommeil(cumulFatigue){ | ||||
|     return ReglesOptionnelles.isUsing("appliquer-fatigue") | ||||
|     ? (this.getFatigueRestante() <= cumulFatigue) | ||||
|     : (this.getEnduranceActuelle() <= cumulFatigue) | ||||
|   } | ||||
|   getFatigueRestante() {return this.getFatigueMax() - this.getFatigueActuelle() } | ||||
|   getFatigueRestante() { return this.getFatigueMax() - this.getFatigueActuelle() } | ||||
|   getFatigueMin() { return this.system.sante.endurance.max - this.system.sante.endurance.value } | ||||
|  | ||||
|   malusFatigue() { | ||||
| @@ -292,7 +287,7 @@ export class RdDBaseActorSang extends RdDBaseActorReve { | ||||
|   } | ||||
|  | ||||
|   isSonne() { | ||||
|     return this.getEffectByStatus(STATUSES.StatusStunned) | ||||
|     return this.getEffect(STATUSES.StatusStunned) | ||||
|   } | ||||
|  | ||||
|   isEffectAllowed(effectId) { return true } | ||||
|   | ||||
| @@ -14,12 +14,11 @@ import { ItemAction } from "../item/item-actions.js"; | ||||
|  * Extend the basic ActorSheet with some very simple modifications | ||||
|  * @extends {ActorSheet} | ||||
|  */ | ||||
| export class RdDBaseActorSheet extends foundry.appv1.sheets.ActorSheet { | ||||
|   static _warnedAppV1 = true | ||||
| export class RdDBaseActorSheet extends ActorSheet { | ||||
|  | ||||
|   /** @override */ | ||||
|   static get defaultOptions() { | ||||
|     return foundry.utils.mergeObject(foundry.appv1.sheets.ActorSheet.defaultOptions, { | ||||
|     return foundry.utils.mergeObject(ActorSheet.defaultOptions, { | ||||
|       classes: ["rdd", "sheet", "actor"], | ||||
|       tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }], | ||||
|       dragDrop: [{ dragSelector: ".item-list .item", dropSelector: undefined }], | ||||
|   | ||||
| @@ -27,7 +27,6 @@ export class RdDBaseActor extends Actor { | ||||
|     } | ||||
|     return entry && entry.length > 0 ? carac[entry[0]] : undefined; | ||||
|   } | ||||
|  | ||||
|   static getDefaultValue(actorType, path) { | ||||
|     if (path.includes('.')) { | ||||
|       path = path.split('.') | ||||
| @@ -214,7 +213,6 @@ 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) { | ||||
| @@ -736,7 +734,7 @@ export class RdDBaseActor extends Actor { | ||||
|       name: this.getAlias(), | ||||
|       system: { description: this.system.description } | ||||
|     } | ||||
|     foundry.applications.handlebars.renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.hbs', chatData) | ||||
|     renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.hbs', chatData) | ||||
|       .then(html => ChatMessage.create(RdDUtility.chatDataSetup(html, modeOverride))); | ||||
|   } | ||||
|  | ||||
| @@ -744,7 +742,6 @@ export class RdDBaseActor extends Actor { | ||||
|     ui.notifications.info(`${this.getAlias()} ne peut pas faire cette action: ${action}`) | ||||
|   } | ||||
|  | ||||
|   isAlcoolise() { return false } | ||||
|   async jetEthylisme() { this.actionImpossible("jet d'éthylisme") } | ||||
|   async rollAppelChance() { this.actionImpossible("appel à la chance") } | ||||
|   async jetDeMoral() { this.actionImpossible("jet de moral") } | ||||
| @@ -757,21 +754,18 @@ export class RdDBaseActor extends Actor { | ||||
|   isActorCombat() { return false } | ||||
|   getCaracInit(competence) { return 0 } | ||||
|  | ||||
|   listAttaques() { | ||||
|     return this.listActions({ isAttaque: true, isEquipe:false }) | ||||
|   } | ||||
|  | ||||
|   listActions({ isAttaque = false, isEquipe=false }) { return [] } | ||||
|  | ||||
|   listActionsCombat() { return [] } | ||||
|   listActionsPossessions() { | ||||
|     return this.itemTypes[ITEM_TYPES.possession] | ||||
|       .map(p => { | ||||
|         return { | ||||
|           name: p.name, | ||||
|           action: 'possession', | ||||
|           possessionid: p.system.possessionid, | ||||
|           system: { | ||||
|             competence: p.name, | ||||
|             possessionid: p.system.possessionid, | ||||
|           } | ||||
|         } | ||||
|       }) | ||||
|   } | ||||
|  | ||||
| } | ||||
| @@ -1,4 +1,6 @@ | ||||
| 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"; | ||||
|  | ||||
| /** | ||||
| @@ -42,8 +44,13 @@ 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))); | ||||
|     this.html.find('.service-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 }); | ||||
| @@ -57,4 +64,28 @@ 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,6 +1,4 @@ | ||||
| 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 { | ||||
| @@ -39,27 +37,4 @@ 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() | ||||
|     }); | ||||
|   } | ||||
|    | ||||
| } | ||||
| @@ -7,9 +7,8 @@ import { CATEGORIES_COMPETENCES, CATEGORIES_DRACONIC, Mapping } from "./mapping. | ||||
|  | ||||
| export class RdDActorExportSheet extends RdDActorSheet { | ||||
|   static init() { | ||||
|     foundry.applications.handlebars.loadTemplates([ | ||||
|     loadTemplates([ | ||||
|       "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/arme.hbs", | ||||
|       "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/arme-titre.hbs", | ||||
|       "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/blessure.hbs", | ||||
|       "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/blessures.hbs", | ||||
|       "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac.hbs", | ||||
| @@ -22,7 +21,7 @@ export class RdDActorExportSheet extends RdDActorSheet { | ||||
|       "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/protection.hbs", | ||||
|       "systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/sort.hbs", | ||||
|     ]) | ||||
|     foundry.documents.collections.Actors.registerSheet(SYSTEM_RDD, RdDActorExportSheet, { types: ["personnage"], makeDefault: false, label: "Feuille simplifiée" }) | ||||
|     Actors.registerSheet(SYSTEM_RDD, RdDActorExportSheet, { types: ["personnage"], makeDefault: false, label: "Feuille simplifiée" }) | ||||
|   } | ||||
|  | ||||
|   static get defaultOptions() { | ||||
| @@ -42,7 +41,6 @@ export class RdDActorExportSheet extends RdDActorSheet { | ||||
|     const formData = await super.getData() | ||||
|     // Add any structured, precomputed list of data | ||||
|     formData.context = Mapping.prepareContext(this.actor) | ||||
|     formData.attaques = this.actor.listActionsAttaque() | ||||
|     formData.export = this.getMappingValues(formData.context, this.actor) | ||||
|     formData.competences = this.getCompetences(CATEGORIES_COMPETENCES) | ||||
|     formData.draconic = this.getCompetences(CATEGORIES_DRACONIC) | ||||
|   | ||||
| @@ -3,7 +3,7 @@ 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/assets/ui/scriptarium.svg">' | ||||
| const IMG_SCRIPTARIUM = '<img class="context-menu-img" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/scriptarium.svg">' | ||||
|  | ||||
| export class ExportScriptarium { | ||||
|  | ||||
| @@ -12,18 +12,14 @@ export class ExportScriptarium { | ||||
|   } | ||||
|  | ||||
|   constructor() { | ||||
|     //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) }) | ||||
|  | ||||
|     Hooks.on("getActorDirectoryFolderContext", (actorDirectory, menus) => { ExportScriptarium.INSTANCE.onActorDirectoryMenu(actorDirectory, menus) }) | ||||
|     Hooks.on("getActorDirectoryEntryContext", (actorDirectory, menus) => { ExportScriptarium.INSTANCE.onActorDirectoryMenu(actorDirectory, menus) }) | ||||
|   } | ||||
|  | ||||
|   onActorDirectoryMenu(actorDirectory, menus) { | ||||
|     // DEBUG console.log("ExportScriptarium.onActorDirectoryMenu", actorDirectory, menus) | ||||
|     menus.push({ | ||||
|       name: 'Export Personnages', | ||||
|       icon: '<i class="fa-solid fa-download"></i>', //IMG_SCRIPTARIUM, | ||||
|       name: 'Export Personnages <i class="fa-regular fa-file-csv"></i>', | ||||
|       icon: IMG_SCRIPTARIUM, | ||||
|       condition: (target) => game.user.isGM && | ||||
|         OptionsAvancees.isUsing(EXPORT_CSV_SCRIPTARIUM) && | ||||
|         this.$getActors(actorDirectory, target).length > 0, | ||||
| @@ -32,28 +28,22 @@ export class ExportScriptarium { | ||||
|   } | ||||
|  | ||||
|   $getTargetName(actorDirectory, target) { | ||||
|     target = $(target) | ||||
|     const li = target.closest(".directory-item") | ||||
|     const folderId = li.data("folderId") | ||||
|     const actorId = li.data("entryId") | ||||
|     const actorId = li.data("documentId") | ||||
|     return actorId | ||||
|       ? game.actors.get(actorId).name | ||||
|       : actorDirectory.collection.filter(it => it.folder.id == folderId).name | ||||
|       : actorDirectory.folders.find(it => it.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("entryId") | ||||
|     const actorId = li.data("documentId") | ||||
|     const actors = actorId | ||||
|       ? [game.actors.get(actorId)] | ||||
|       : folderId | ||||
|         ? actorDirectory.collection.filter(it => it.folder.id == folderId) | ||||
|         ? actorDirectory.folders.find(it => it.id == folderId).contents | ||||
|         : [] | ||||
|     return actors.filter(it => it.type == ACTOR_TYPES.personnage) | ||||
|   } | ||||
| @@ -64,7 +54,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`; | ||||
|     foundry.utils.saveDataToFile(data, "text/csv;charset=windows-1252", `${filename}`); | ||||
|     saveDataToFile(data, "text/csv;charset=windows-1252", `${filename}`); | ||||
|   } | ||||
|  | ||||
|   getHeaderLine() { | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| import { Grammar } from "../../grammar.js" | ||||
| import { RdDItemArme } from "../../item/arme.js" | ||||
| import { RdDItemArme } from "../../item-arme.js" | ||||
| import { RdDItemCompetence } from "../../item-competence.js" | ||||
| import { RdDItemSort } from "../../item-sort.js" | ||||
| import { ITEM_TYPES } from "../../constants.js" | ||||
| @@ -144,7 +144,7 @@ export class Mapping { | ||||
|     armes.push(RdDItemArme.corpsACorps(actor)); | ||||
|     armes.push(RdDItemArme.empoignade(actor)); | ||||
|     return armes.map(arme => [ | ||||
|       arme.system.unemain ? Mapping.prepareArme(actor, arme, '(1 main)') : undefined, | ||||
|       arme.system.unemain ? Mapping.prepareArme(actor, arme, 'unemain') : undefined, | ||||
|       arme.system.deuxmains ? Mapping.prepareArme(actor, arme, 'deuxmains') : undefined, | ||||
|       !(arme.system.unemain || arme.system.deuxmains) ? Mapping.prepareArme(actor, arme, 'competence') : undefined, | ||||
|       arme.system.lancer != "" ? Mapping.prepareArme(actor, arme, 'lancer') : undefined, | ||||
| @@ -256,8 +256,8 @@ export class Mapping { | ||||
|   static descriptionSort(sort) { | ||||
|     const ptSeuil = Array(sort.system.coutseuil).map(it => '*') | ||||
|     const caseTMR = sort.system.caseTMRspeciale.length > 0 ? Mapping.toVar(sort.system.caseTMRspeciale) : Misc.upperFirst(TMRType[sort.system.caseTMR].name) | ||||
|     const coutReve =RdDItemSort.coutReve(sort) | ||||
|     const diff = RdDItemSort.diffReve(sort) | ||||
|     const coutReve = 'r' + RdDItemSort.addSpaceToNonNumeric(sort.system.ptreve) | ||||
|     const diff = 'R' + RdDItemSort.addSpaceToNonNumeric(sort.system.difficulte) | ||||
|     return `${sort.name}${ptSeuil} (${caseTMR}) ${diff} ${coutReve}` | ||||
|   } | ||||
|   static toVar(caseSpeciale) { | ||||
|   | ||||
| @@ -26,7 +26,7 @@ const RANDOM_VALUES = { | ||||
|  | ||||
| export class AppPersonnageAleatoire extends FormApplication { | ||||
|   static preloadHandlebars() { | ||||
|     foundry.applications.handlebars.loadTemplates([ | ||||
|     loadTemplates([ | ||||
|       'systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs', | ||||
|     ]) | ||||
|   } | ||||
|   | ||||
| @@ -1,5 +0,0 @@ | ||||
| export { default as RdDItemBaseSheet} from "./common-item-sheet.mjs" | ||||
| export { default as RdDMonnaieSheet } from "./monnaie-sheet.mjs" | ||||
| export { default as RdDMunitionSheet } from "./munition-sheet.mjs" | ||||
| export { default as RdDTarotSheet } from "./tarot-sheet.mjs" | ||||
|  | ||||
| @@ -1,111 +0,0 @@ | ||||
| const { HandlebarsApplicationMixin } = foundry.applications.api | ||||
| import { SYSTEM_RDD } from "../../constants.js" | ||||
| import { Misc } from "../../misc.js" | ||||
| import { RdDSheetUtility } from "../../rdd-sheet-utility.js"; | ||||
|  | ||||
|  | ||||
| export default class RdDItemBaseSheet extends HandlebarsApplicationMixin(foundry.applications.sheets.ItemSheetV2) { | ||||
|  | ||||
|   static preloadHandlebars(...templatesList) { | ||||
|     const handlebars = ["systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/header.hbs"] | ||||
|     templatesList.forEach(templates => | ||||
|       templates.forEach(t => | ||||
|         t.handlebars().forEach(h => handlebars.push(h)) | ||||
|       ) | ||||
|     ) | ||||
|     loadTemplates(Misc.distinct(handlebars)) | ||||
|   } | ||||
|  | ||||
|   static register(sheetClass) { | ||||
|     const itemType = sheetClass.ITEM_TYPE | ||||
|     Items.registerSheet(SYSTEM_RDD, sheetClass, { | ||||
|       label: Misc.typeName('Item', itemType), | ||||
|       types: [itemType], | ||||
|       makeDefault: true | ||||
|     }) | ||||
|   } | ||||
|  | ||||
|   static registerAll(...sheetClasses) { | ||||
|     const handlebars = ["systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/header.hbs"] | ||||
|     sheetClasses.forEach(sheetClass => { | ||||
|       sheetClass.TEMPLATES.forEach(t => | ||||
|         t.handlebars().forEach(h => handlebars.push(h)) | ||||
|       ) | ||||
|       const itemType = sheetClass.ITEM_TYPE | ||||
|       foundry.documents.collections.Items.registerSheet(SYSTEM_RDD, sheetClass, { | ||||
|         label: Misc.typeName('Item', itemType), | ||||
|         types: [itemType], | ||||
|         makeDefault: true | ||||
|       }) | ||||
|     }) | ||||
|     foundry.applications.handlebars.loadTemplates(Misc.distinct(handlebars)) | ||||
|   } | ||||
|  | ||||
|   static get ITEM_TYPE() { return undefined } | ||||
|  | ||||
|   constructor(options = {}) { | ||||
|     super(options) | ||||
|   } | ||||
|  | ||||
|   static get TEMPLATES() { return [] } | ||||
|  | ||||
|   /** @override */ | ||||
|   static DEFAULT_OPTIONS = { | ||||
|     classes: ["fvtt-rdd", "item"], | ||||
|     position: { | ||||
|       width: 448, | ||||
|       height: "auto", | ||||
|     }, | ||||
|     form: { | ||||
|       submitOnChange: true, | ||||
|     }, | ||||
|     window: { | ||||
|       resizable: true, | ||||
|     }, | ||||
|     actions: { | ||||
|       editImage: RdDItemBaseSheet.#onEditImage, | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   /** @override */ | ||||
|   async _prepareContext() { | ||||
|     return { | ||||
|       item: this.document, | ||||
|       options: RdDSheetUtility.getOptions(this.document, this.isEditable), | ||||
|       fields: this.document.schema.fields, | ||||
|       systemFields: this.document.system.schema.fields, | ||||
|       system: this.document.system, | ||||
|       source: this.document.toObject(), | ||||
|       isEditable: this.isEditable, | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   // #region Actions | ||||
|  | ||||
|   /** | ||||
|    * Handle changing a Document's image. | ||||
|    * | ||||
|    * @this RdDItemBaseSheet | ||||
|    * @param {PointerEvent} event   The originating click event | ||||
|    * @param {HTMLElement} target   The capturing HTML element which defined a [data-action] | ||||
|    * @returns {Promise} | ||||
|    * @private | ||||
|    */ | ||||
|   static async #onEditImage(event, target) { | ||||
|     const attr = target.dataset.edit | ||||
|     const current = foundry.utils.getProperty(this.document, attr) | ||||
|     const { img } = this.document.constructor.getDefaultArtwork?.(this.document.toObject()) ?? {} | ||||
|     const fp = new FilePicker({ | ||||
|       current, | ||||
|       type: "image", | ||||
|       redirectToRoot: img ? [img] : [], | ||||
|       callback: (path) => { | ||||
|         this.document.update({ [attr]: path }) | ||||
|       }, | ||||
|       top: this.position.top + 40, | ||||
|       left: this.position.left + 10, | ||||
|     }) | ||||
|     return fp.browse() | ||||
|   } | ||||
|   // #endregion | ||||
| } | ||||
| @@ -1,35 +0,0 @@ | ||||
| import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs"; | ||||
| import { ITEM_TYPES } from "../../constants.js"; | ||||
| import RdDItemBaseSheet from "./common-item-sheet.mjs"; | ||||
|  | ||||
| export default class RdDMonnaieSheet extends RdDItemBaseSheet { | ||||
|  | ||||
|   /** @override */ | ||||
|   static get ITEM_TYPE() { return ITEM_TYPES.monnaie } | ||||
|   static get TEMPLATES() { return [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE] } | ||||
|  | ||||
|   /** @override */ | ||||
|   static DEFAULT_OPTIONS = Object.assign({}, | ||||
|     RdDItemBaseSheet.DEFAULT_OPTIONS, | ||||
|     { | ||||
|       classes: ["fvtt-rdd", "item", "monnaie"], | ||||
|       position: { width: 448 }, | ||||
|       window: { contentClasses: ["monnaie-content"] } | ||||
|     }) | ||||
|  | ||||
|   /** @override */ | ||||
|   static PARTS = { | ||||
|     main: { | ||||
|       template: "systems/foundryvtt-reve-de-dragon/templates/sheets/item/monnaie.hbs", | ||||
|     }, | ||||
|   } | ||||
|  | ||||
|   /** @override */ | ||||
|   async _prepareContext() { | ||||
|     return Object.assign( | ||||
|       await super._prepareContext(), | ||||
|       await TEMPLATE_DESCRIPTION.prepareContext(this.document), | ||||
|       await TEMPLATE_INVENTAIRE.prepareContext(this.document) | ||||
|     ) | ||||
|   } | ||||
| } | ||||
| @@ -1,34 +0,0 @@ | ||||
| import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs"; | ||||
| import { ITEM_TYPES } from "../../constants.js"; | ||||
| import RdDItemBaseSheet from "./common-item-sheet.mjs"; | ||||
|  | ||||
| export default class RdDMunitionSheet extends RdDItemBaseSheet { | ||||
|   /** @override */ | ||||
|   static get ITEM_TYPE() { return ITEM_TYPES.munition } | ||||
|   static get TEMPLATES() { return [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE] } | ||||
|  | ||||
|   /** @override */ | ||||
|   static DEFAULT_OPTIONS = Object.assign({}, | ||||
|     RdDItemBaseSheet.DEFAULT_OPTIONS, | ||||
|     { | ||||
|       classes: ["fvtt-rdd", "item", "munition"], | ||||
|       position: { width: 448 }, | ||||
|       window: { contentClasses: ["munition-content"] } | ||||
|     }) | ||||
|  | ||||
|   /** @override */ | ||||
|   static PARTS = { | ||||
|     main: { | ||||
|       template: "systems/foundryvtt-reve-de-dragon/templates/sheets/item/munition.hbs", | ||||
|     }, | ||||
|   } | ||||
|  | ||||
|   /** @override */ | ||||
|   async _prepareContext() { | ||||
|     return Object.assign( | ||||
|       await super._prepareContext(), | ||||
|       await TEMPLATE_DESCRIPTION.prepareContext(this.document), | ||||
|       await TEMPLATE_INVENTAIRE.prepareContext(this.document) | ||||
|     ) | ||||
|   } | ||||
| } | ||||
| @@ -1,33 +0,0 @@ | ||||
| import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs"; | ||||
| import { ITEM_TYPES } from "../../constants.js"; | ||||
| import RdDItemBaseSheet from "./common-item-sheet.mjs"; | ||||
|  | ||||
| export default class RdDTarotSheet extends RdDItemBaseSheet { | ||||
|   /** @override */ | ||||
|   static get ITEM_TYPE() { return ITEM_TYPES.tarot } | ||||
|   static get TEMPLATES() { return [TEMPLATE_DESCRIPTION] } | ||||
|  | ||||
|   /** @override */ | ||||
|   static DEFAULT_OPTIONS = Object.assign({}, | ||||
|     RdDItemBaseSheet.DEFAULT_OPTIONS, | ||||
|     { | ||||
|       classes: ["fvtt-rdd", "item", "tarot"], | ||||
|       position: { width: 448 }, | ||||
|       window: { contentClasses: ["tarot-content"] } | ||||
|     }) | ||||
|  | ||||
|   /** @override */ | ||||
|   static PARTS = { | ||||
|     main: { | ||||
|       template: "systems/foundryvtt-reve-de-dragon/templates/sheets/item/tarot.hbs", | ||||
|     }, | ||||
|   } | ||||
|  | ||||
|   /** @override */ | ||||
|   async _prepareContext() { | ||||
|     return Object.assign( | ||||
|       await super._prepareContext(), | ||||
|       await TEMPLATE_DESCRIPTION.prepareContext(this.document) | ||||
|     ) | ||||
|   } | ||||
| } | ||||
| @@ -13,7 +13,7 @@ const TEXT_ROLL_MANAGERS = [ | ||||
|  | ||||
| export class RdDTextEditor { | ||||
|   static registerChatCallbacks(html) { | ||||
|     $(html).on("click", '.roll-text', async event => await RdDTextEditor.rollText(event)) | ||||
|     html.on("click", '.roll-text', async event => await RdDTextEditor.rollText(event)) | ||||
|   } | ||||
|  | ||||
|   static async enrichHTML(text, object, options = {showlink:true}) { | ||||
| @@ -30,7 +30,7 @@ export class RdDTextEditor { | ||||
|       context.text = await manager.onReplaceRoll(context); | ||||
|     } | ||||
|  | ||||
|     return await foundry.applications.ux.TextEditor.implementation.enrichHTML(context.text, { | ||||
|     return await TextEditor.enrichHTML(context.text, { | ||||
|       relativeTo: object, | ||||
|       secrets: object?.isOwner, | ||||
|       async: true | ||||
|   | ||||
| @@ -5,7 +5,7 @@ import { RdDUtility } from "../../rdd-utility.js"; | ||||
| import { RdDAlchimie } from "../../rdd-alchimie.js"; | ||||
| import { TextRollManager } from "./text-roll-formatter.js"; | ||||
|  | ||||
| const REGEX_ALCHIMIE_TERMES = "(?<termes>([-A-Za-zÀ-ÖØ-öø-ÿ ])+)" | ||||
| const REGEX_ALCHIMIE_TERMES = "(?<termes>(\\w|-)+)" | ||||
| const REGEX_ALCHIMIE_MANIP = "(?<manip>(couleur|consistance))" | ||||
| const XREGEXP_ROLL_ALCHIMIE = XRegExp("@roll\\[" + REGEX_ALCHIMIE_MANIP + "\\s+" + REGEX_ALCHIMIE_TERMES + "\\]", 'giu') | ||||
| const XREGEXP_ROLL_ALCHIMIE_MANIP = XRegExp("@" + REGEX_ALCHIMIE_MANIP + "\\{" + REGEX_ALCHIMIE_TERMES + "\\}", 'giu') | ||||
|   | ||||
| @@ -5,12 +5,12 @@ import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js"; | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Class providing helper methods to get the list of users, and | ||||
|  * Class providing helper methods to get the list of users, and  | ||||
|  */ | ||||
| export class ChatUtility { | ||||
|  | ||||
|   static async init() { | ||||
|     Hooks.on("renderChatMessageHTML", async (app, html, msg) => await ChatUtility.onRenderChatMessage(app, html, msg)) | ||||
|     Hooks.on("renderChatMessage", async (app, html, msg) => await ChatUtility.onRenderChatMessage(app, html, msg)) | ||||
|     Hooks.on("createChatMessage", async (chatMessage, options, id) => await ChatUtility.onCreateChatMessage(chatMessage, options, id)) | ||||
|   } | ||||
|  | ||||
| @@ -83,8 +83,8 @@ export class ChatUtility { | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   static async createChatWithRollMode(messageData, actor = undefined, rollMode = game.settings.get("core", "rollMode")) { | ||||
|     switch (rollMode) { | ||||
|   static async createChatWithRollMode(messageData, actor = undefined) { | ||||
|     switch (game.settings.get("core", "rollMode")) { | ||||
|       case "blindroll": // GM only | ||||
|         if (!game.user.isGM) { | ||||
|           ChatUtility.blindMessageToGM(messageData) | ||||
| @@ -190,8 +190,8 @@ export class ChatUtility { | ||||
|     if (rddTimestamp) { | ||||
|       const timestamp = new RdDTimestamp(rddTimestamp); | ||||
|       const timestampData = timestamp.toCalendrier(); | ||||
|       const dateHeure = await foundry.applications.handlebars.renderTemplate('systems/foundryvtt-reve-de-dragon/templates/common/date-heure.hbs', timestampData); | ||||
|       $(html).find('header.message-header .message-sender').after(dateHeure) | ||||
|       const dateHeure = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/common/date-heure.hbs', timestampData); | ||||
|       html.find('header.message-header .message-sender').after(dateHeure) | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -5,13 +5,13 @@ const INFO_COEUR = 'info-coeur'; | ||||
|  | ||||
| export class RdDCoeur { | ||||
|   static registerChatCallbacks(html) { | ||||
|     $(html).on("click", 'a.accepter-tendre-moment', event => { | ||||
|     html.on("click", 'a.accepter-tendre-moment', event => { | ||||
|       RdDCoeur.accepterTendreMoment(RdDCoeur.extractInfoCoeur(event)) | ||||
|     }) | ||||
|     $(html).on("click", 'a.refuser-tendre-moment', event => { | ||||
|     html.on("click", 'a.refuser-tendre-moment', event => { | ||||
|       RdDCoeur.refuserTendreMoment(RdDCoeur.extractInfoCoeur(event)) | ||||
|     }) | ||||
|     $(html).on("click", 'a.perdre-point-coeur-douceur', event => { | ||||
|     html.on("click", 'a.perdre-point-coeur-douceur', event => { | ||||
|       RdDCoeur.perdreEnDouceur( | ||||
|         RdDCoeur.extractInfoCoeur(event), | ||||
|         event.currentTarget.attributes['data-actor-id'].value) | ||||
|   | ||||
| @@ -1,8 +0,0 @@ | ||||
| import { CommonDescription } from "./description.mjs"; | ||||
| import { CommonInventaire } from "./inventaire.mjs"; | ||||
|  | ||||
| export const TEMPLATE_DESCRIPTION = new CommonDescription() | ||||
| export const TEMPLATE_INVENTAIRE = new CommonInventaire() | ||||
|  | ||||
| export const ALL_COMMON_TEMPLATES = [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE] | ||||
|  | ||||
| @@ -1,10 +0,0 @@ | ||||
| /** | ||||
|  * class describing common methods implemented by template parts, | ||||
|  * used for sheet/models/documents | ||||
|  */ | ||||
| export default class CommonTemplate { | ||||
|   fields() { } | ||||
|   handlebars() { return [] } | ||||
|   actions() { return {} } | ||||
|   async prepareContext(item) { } | ||||
| } | ||||
| @@ -1,32 +0,0 @@ | ||||
| import { RdDTextEditor } from "../apps/rdd-text-roll-editor.js" | ||||
| import CommonTemplate from "./common-template.mjs" | ||||
| import { HTMLSTRING } from "./field-types.mjs" | ||||
|  | ||||
| const fields = foundry.data.fields | ||||
|  | ||||
| export class CommonDescription extends CommonTemplate { | ||||
|   fields() { | ||||
|     return { | ||||
|       description: new fields.HTMLField({ ...HTMLSTRING }), | ||||
|       descriptionmj: new fields.HTMLField({ gmOnly: true, ...HTMLSTRING }) | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   handlebars() { | ||||
|     return [ | ||||
|       "systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-description.hbs", | ||||
|     ] | ||||
|   } | ||||
|   actions() { | ||||
|     return {} | ||||
|   } | ||||
|  | ||||
|   async prepareContext(item) { | ||||
|     const enriched = { | ||||
|       description: await RdDTextEditor.enrichHTML(item.system.description, item), | ||||
|       descriptionmj: await RdDTextEditor.enrichHTML(item.system.descriptionmj, item), | ||||
|     } | ||||
|     return { enriched } | ||||
|   } | ||||
|  | ||||
| } | ||||
| @@ -1,9 +0,0 @@ | ||||
| export const INTEGER = { required: true, nullable: false, min: 0, integer: true } | ||||
| export const DECIMAL = { required: true, nullable: false, min: 0, integer: false } /* TODO: validation de nombre décimales?*/ | ||||
| export const INTEGER_SIGNED = { required: true, nullable: false, integer: true } | ||||
| export const DECIMAL_SIGNED = { required: true, nullable: false, integer: false } | ||||
| export const STRING = { required: true, nullable: false, blank: true, trim: true } | ||||
| export const HTMLSTRING = { initial: "", required: true, nullable: false, blank: true, textSearch: true } | ||||
|  | ||||
| export const MODEL_ARRAY = { initial: [], required: true, nullable: false } | ||||
|  | ||||
| @@ -1,36 +0,0 @@ | ||||
| import CommonTemplate from "./common-template.mjs" | ||||
| import { RARETES } from "../item/raretes.js" | ||||
| import { DECIMAL, INTEGER, INTEGER_SIGNED, MODEL_ARRAY, STRING } from "./field-types.mjs" | ||||
|  | ||||
| const fields = foundry.data.fields | ||||
|  | ||||
| export class CommonInventaire extends CommonTemplate { | ||||
|   fields() { | ||||
|     return { | ||||
|       encombrement: new fields.NumberField({ label: "Encombrement", initial: 0, ...INTEGER }), | ||||
|       quantite: new fields.NumberField({ label: "Quantité", initial: 1, ...INTEGER }), | ||||
|       qualite: new fields.NumberField({ label: "Qualité", initial: 0, ...INTEGER_SIGNED }), | ||||
|       cout: new fields.NumberField({ label: "Coût", initial: 0.0, ...DECIMAL }), | ||||
|       environnement: new fields.ArrayField( | ||||
|         new fields.SchemaField({ | ||||
|           milieu: new fields.StringField({ label: "Milieu", initial: "", ...STRING }), | ||||
|           rarete: new fields.StringField({ | ||||
|             label: "Rareté", initial: RARETES[0].code, ...STRING, | ||||
|             validate: (value, options) => RARETES.find(it => it.code == value) | ||||
|           }), | ||||
|           frequence: new fields.NumberField({ label: "Fréquence", initial: RARETES[0].frequence, ...INTEGER }), | ||||
|         }), | ||||
|         { label: "Environnement", ...MODEL_ARRAY }), | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   handlebars() { | ||||
|     return [ | ||||
|       "systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-inventaire.hbs" | ||||
|     ] | ||||
|   } | ||||
|  | ||||
|   async prepareContext(item) { | ||||
|     return {} | ||||
|   } | ||||
| } | ||||
| @@ -1,3 +0,0 @@ | ||||
| export { default as RdDModelMonnaie } from "./monnaie.mjs" | ||||
| export { default as RdDModelMunition } from "./munition.mjs" | ||||
| export { default as RdDModelTarot } from "./tarot.mjs" | ||||
| @@ -1,11 +0,0 @@ | ||||
| import { RdDItem } from "../item.js"; | ||||
|  | ||||
| export default class RdDItemMonnaie extends RdDItem { | ||||
|  | ||||
|   constructor(data, context) { | ||||
|     if (!data.img) { | ||||
|       data.img = 'systems/foundryvtt-reve-de-dragon/icons/objets/piece_etain_poisson.webp' | ||||
|     } | ||||
|     super(data, context); | ||||
|   } | ||||
| } | ||||
| @@ -1,7 +0,0 @@ | ||||
| import { RdDItem } from "../item.js"; | ||||
|  | ||||
| export default class RdDItemMunition extends RdDItem { | ||||
|   static get defaultIcon() { | ||||
|     return 'systems/foundryvtt-reve-de-dragon/icons/objets/fleche.webp' | ||||
|   } | ||||
| } | ||||
| @@ -1,7 +0,0 @@ | ||||
| import { RdDItem } from "../item.js"; | ||||
|  | ||||
| export default class RdDItemTarot extends RdDItem { | ||||
|   static get defaultIcon() { | ||||
|     return 'systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.webp' | ||||
|   } | ||||
| } | ||||
| @@ -4,7 +4,8 @@ import { Misc } from "../misc.js" | ||||
|  | ||||
| export const ACTION_ITEM_ENCHANTER =  { | ||||
|   code: 'item-enchanter', label: 'Enchanter', icon: it => 'fa-solid fa-sparkles', | ||||
|   filter: it => game.user.isGM || DialogEnchanter.isEnchantable(it) && it.parent?.type != ACTOR_TYPES.commerce, | ||||
|   filter: it => game.user.isGM || DialogEnchanter.isEnchantable(it), | ||||
|   optionsFilter: options => options.editable, | ||||
|   action: (item, actor) => DialogEnchanter.enchanter(item) | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -22,7 +22,7 @@ export class Grammar { | ||||
|   static equalsInsensitive(a, b) { | ||||
|     return Grammar.toLowerCaseNoAccent(a) == Grammar.toLowerCaseNoAccent(b) | ||||
|   } | ||||
|  | ||||
|    | ||||
|   static includesLowerCaseNoAccent(value, content) { | ||||
|     return Grammar.toLowerCaseNoAccent(value)?.includes(Grammar.toLowerCaseNoAccent(content)); | ||||
|   } | ||||
|   | ||||
| @@ -1,7 +0,0 @@ | ||||
| export class RdDInitiative { | ||||
|  | ||||
|   static calculInitiative(niveau, caracValue, bonus = 0) { | ||||
|     let base = niveau + Math.floor(caracValue / 2) + bonus; | ||||
|     return "1d6" + (base >= 0 ? "+" : "") + base; | ||||
|   } | ||||
| }  | ||||
| @@ -1,10 +1,8 @@ | ||||
| import { ITEM_TYPES } from "../constants.js"; | ||||
| import { RdDItem } from "../item.js"; | ||||
| 
 | ||||
| import { RdDItemCompetenceCreature } from "../item-competencecreature.js" | ||||
| import { BASE_CORPS_A_CORPS } from "./base-items.js"; | ||||
| import { Grammar } from "../grammar.js"; | ||||
| import { RdDInitiative } from "../initiative.mjs"; | ||||
| import { Grammar } from "./grammar.js"; | ||||
| import { RdDItemCompetenceCreature } from "./item-competencecreature.js" | ||||
| import { ITEM_TYPES } from "./constants.js"; | ||||
| import { BASE_CORPS_A_CORPS } from "./item/base-items.js"; | ||||
| import { RdDCombatManager } from "./rdd-combat.js"; | ||||
| 
 | ||||
| const nomCategorieParade = { | ||||
|   "sans-armes": "Sans arme", | ||||
| @@ -21,21 +19,13 @@ const nomCategorieParade = { | ||||
| } | ||||
| 
 | ||||
| /* -------------------------------------------- */ | ||||
| export class RdDItemArme extends RdDItem { | ||||
| export class RdDItemArme extends Item { | ||||
| 
 | ||||
|   static get ITEM_TYPE() { return ITEM_TYPES.arme } | ||||
| 
 | ||||
|   static get defaultIcon() { | ||||
|     return defaultItemImgArme | ||||
|     //return "systems/foundryvtt-reve-de-dragon/icons/armes_armure/epee_sord.webp";
 | ||||
|   } | ||||
| 
 | ||||
|   penetration() { | ||||
|     return parseInt(this.system.penetration ?? 0); | ||||
|   static isArme(item) { | ||||
|     return item.type == ITEM_TYPES.arme || RdDItemCompetenceCreature.getCategorieAttaque(item); | ||||
|   } | ||||
| 
 | ||||
|   /* -------------------------------------------- */ | ||||
| 
 | ||||
|   static getArme(arme) { | ||||
|     switch (arme ? arme.type : '') { | ||||
|       case ITEM_TYPES.arme: return arme; | ||||
| @@ -52,10 +42,10 @@ export class RdDItemArme extends RdDItem { | ||||
|       case ITEM_TYPES.arme: | ||||
|         switch (maniement) { | ||||
|           case 'competence': return arme.system.competence; | ||||
|           case '(1 main)': return arme.competence1Mains() | ||||
|           case '(2 mains)': return arme.competence2Mains() | ||||
|           case '(tir)': case 'tir': return arme.system.tir | ||||
|           case '(lancer)': case 'lancer': return arme.system.lancer; | ||||
|           case 'unemain': return RdDItemArme.competence1Mains(arme); | ||||
|           case 'deuxmains': return RdDItemArme.competence2Mains(arme); | ||||
|           case 'tir': return arme.system.tir; | ||||
|           case 'lancer': return arme.system.lancer; | ||||
|         } | ||||
|     } | ||||
|     return undefined | ||||
| @@ -130,13 +120,13 @@ export class RdDItemArme extends RdDItem { | ||||
| 
 | ||||
|   static defenseArmeParade(armeAttaque, armeParade) { | ||||
|     const defCategory = RdDItemArme.getCategorieParade(armeParade) | ||||
|     if (defCategory == 'boucliers') { | ||||
|     if (defCategory == 'bouclier') { | ||||
|       return 'norm' | ||||
|     } | ||||
|     if (armeAttaque?.system?.competence?.toLowerCase().match(/(fléau)/)) { | ||||
|     if (armeAttaque.system.competence.toLowerCase().match(/(fléau)/)) { | ||||
|       return '' | ||||
|     } | ||||
|     if (armeParade.system?.tir) { | ||||
|     if (armeParade.system.tir) { | ||||
|       return '' | ||||
|     } | ||||
|     const attCategory = RdDItemArme.getCategorieParade(armeAttaque) | ||||
| @@ -196,7 +186,7 @@ export class RdDItemArme extends RdDItem { | ||||
|         return Number(arme.system.dommages) | ||||
|       } | ||||
|       const tableauDegats = arme.system.dommages.split("/"); | ||||
|       return Number(tableauDegats[maniement == '(1 main)' ? 0 : 1]) | ||||
|       return Number(tableauDegats[maniement == 'unemain' ? 0 : 1]) | ||||
|     } | ||||
|     return Number(arme.system.dommages); | ||||
|   } | ||||
| @@ -205,17 +195,17 @@ export class RdDItemArme extends RdDItem { | ||||
|   static armeUneOuDeuxMains(arme, aUneMain) { | ||||
|     if (arme && !arme.system.cac) { | ||||
|       arme = foundry.utils.duplicate(arme); | ||||
|       arme.system.dommagesReels = RdDItemArme.dommagesReels(arme, aUneMain ? '(1 main)' : '(2 mains)') | ||||
|       arme.system.dommagesReels = RdDItemArme.dommagesReels(arme, aUneMain ? 'unemain' : 'deuxmains') | ||||
|     } | ||||
|     return arme; | ||||
|   } | ||||
| 
 | ||||
|   competence1Mains() { | ||||
|     return this.system.competence.replace(" 2 mains", " 1 main"); | ||||
|   static competence1Mains(arme) { | ||||
|     return arme.system.competence.replace(" 2 mains", " 1 main"); | ||||
|   } | ||||
| 
 | ||||
|   competence2Mains() { | ||||
|     return this.system.competence.replace(" 1 main", " 2 mains"); | ||||
|   static competence2Mains(arme) { | ||||
|     return arme.system.competence.replace(" 1 main", " 2 mains"); | ||||
|   } | ||||
| 
 | ||||
|   static isUtilisable(arme) { | ||||
| @@ -228,8 +218,10 @@ export class RdDItemArme extends RdDItem { | ||||
| 
 | ||||
|   static isAttaque(arme) { | ||||
|     switch (arme.type) { | ||||
|       case ITEM_TYPES.arme: return arme.system.equipe && (arme.system.resistance > 0 || arme.system.portee_courte > 0) | ||||
|       case ITEM_TYPES.competencecreature: return arme.system.iscombat && RdDItemCompetenceCreature.isAttaque(item) | ||||
|       case ITEM_TYPES.arme: | ||||
|         return arme.system.equipe && (arme.system.resistance > 0 || arme.system.portee_courte > 0) | ||||
|       case ITEM_TYPES.competencecreature: | ||||
|         return arme.system.iscombat && RdDItemCompetenceCreature.isAttaque(item) | ||||
|     } | ||||
|     return false | ||||
|   } | ||||
| @@ -237,24 +229,23 @@ export class RdDItemArme extends RdDItem { | ||||
|   static isParade(arme) { | ||||
|     switch (arme.type) { | ||||
|       case ITEM_TYPES.arme: | ||||
|         return arme.system.resistance > 0 && true/* TODO: regarder la categorie d'arme?*/ | ||||
|         return arme.system.equipe && arme.system.resistance > 0 && true/* TODO: regarder la categorie d'arme?*/ | ||||
|       case ITEM_TYPES.competencecreature: | ||||
|         return arme.system.iscombat && RdDItemCompetenceCreature.isParade(arme) | ||||
|     } | ||||
|     return false | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
|   static corpsACorps(actor) { | ||||
|     let competence = actor?.getCompetenceCorpsACorps() ?? BASE_CORPS_A_CORPS | ||||
|     let melee = actor ? actor.system.carac['melee'].value : 0 | ||||
|     return new RdDItemArme({ | ||||
|     return { | ||||
|       _id: competence.id, | ||||
|       name: 'Corps à corps', | ||||
|       type: ITEM_TYPES.arme, | ||||
|       img: competence.img, | ||||
|       system: { | ||||
|         initiative: RdDInitiative.calculInitiative(competence.system.niveau, melee), | ||||
|         initiative: RdDCombatManager.calculInitiative(competence.system.niveau, melee), | ||||
|         equipe: true, | ||||
|         rapide: true, | ||||
|         force: 0, | ||||
| @@ -268,7 +259,7 @@ export class RdDItemArme extends RdDItem { | ||||
|         deuxmains: true, | ||||
|         categorie_parade: 'sans-armes' | ||||
|       } | ||||
|     }) | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   static mainsNues(actor) { | ||||
| @@ -103,8 +103,8 @@ export class RdDItemCompetence extends Item { | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   static isMalusEncombrementTotal(competenceName) { | ||||
|     return competenceName?.toLowerCase().match(/(natation|acrobatie)/) || 0; | ||||
|   static isMalusEncombrementTotal(competence) { | ||||
|     return competence?.name.toLowerCase().match(/(natation|acrobatie)/) || 0; | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   | ||||
| @@ -1,8 +1,7 @@ | ||||
|  | ||||
| import { ITEM_TYPES } from "./constants.js"; | ||||
| import { Grammar } from "./grammar.js"; | ||||
| import { RdDInitiative } from "./initiative.mjs"; | ||||
| import { RdDItem } from "./item.js"; | ||||
| import { RdDCombatManager } from "./rdd-combat.js"; | ||||
|  | ||||
| export const CATEGORIES_COMPETENCES_CREATURES = { | ||||
|   "generale": { base: 0, label: "Générale" }, | ||||
| @@ -38,7 +37,7 @@ export class RdDItemCompetenceCreature extends Item { | ||||
|           competence: item.name, | ||||
|           cac: categorieAttaque == "naturelle" ? "naturelle" : "", | ||||
|           niveau: item.system.niveau, | ||||
|           initiative: RdDInitiative.calculInitiative(item.system.niveau, item.system.carac_value), | ||||
|           initiative: RdDCombatManager.calculInitiative(item.system.niveau, item.system.carac_value), | ||||
|           equipe: true, | ||||
|           resistance: 100, | ||||
|           dommagesReels: item.system.dommages, | ||||
| @@ -50,44 +49,6 @@ export class RdDItemCompetenceCreature extends Item { | ||||
|     } | ||||
|     return undefined; | ||||
|   } | ||||
|   static attaqueCreature(comp) { | ||||
|     const categorieAttaque = RdDItemCompetenceCreature.getCategorieAttaque(comp) | ||||
|     if (categorieAttaque != undefined) { | ||||
|       const initative = RdDInitiative.calculInitiative(comp.system.niveau, comp.system.carac_value); | ||||
|       const armeComp = new RdDItem({ | ||||
|         name: comp.name, | ||||
|         type: ITEM_TYPES.arme, | ||||
|         img: comp.img, | ||||
|         system: { | ||||
|           competence: comp.name, | ||||
|           cac: categorieAttaque == "naturelle" ? "naturelle" : "", | ||||
|           niveau: comp.system.niveau, | ||||
|           initiative: initative, | ||||
|           mortalite: comp.system.mortalite, | ||||
|           dommages: comp.system.dommages, | ||||
|           equipe: true, | ||||
|           resistance: 100, | ||||
|           penetration: 0, | ||||
|           force: 0, | ||||
|           rapide: true, | ||||
|         } | ||||
|       }); | ||||
|       const attaque = { | ||||
|         name: comp.name, | ||||
|         action: comp.isCompetencePossession() ? 'possession' : 'attaque', | ||||
|         initOnly: false, | ||||
|         arme: armeComp, | ||||
|         comp: comp, | ||||
|         carac: { key: comp.name, value: comp.system.carac_value }, | ||||
|         equipe: true, | ||||
|         mortalite: comp.system.mortalite, | ||||
|         dmg: comp.system.dommages, | ||||
|         initiative: initative | ||||
|       }; | ||||
|       return attaque | ||||
|     } | ||||
|     return undefined; | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   static isAttaque(item) { | ||||
|   | ||||
| @@ -14,11 +14,12 @@ import { RdDItem } from "./item.js"; | ||||
| import { FLEUVE_COORD, TMRUtility } from "./tmr-utility.js"; | ||||
| import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js"; | ||||
| import { ItemAction } from "./item/item-actions.js"; | ||||
| import { RdDItemGemme } from "./item/gemme.js"; | ||||
|  | ||||
| /** | ||||
|  * Extend the basic ItemSheet for RdD specific items | ||||
|  */ | ||||
| export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet { | ||||
| export class RdDItemSheet extends ItemSheet { | ||||
|  | ||||
|   static get ITEM_TYPE() { | ||||
|     return undefined | ||||
| @@ -31,7 +32,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet { | ||||
|   } | ||||
|  | ||||
|   static register(sheetClass) { | ||||
|     foundry.documents.collections.Items.registerSheet(SYSTEM_RDD, sheetClass, { | ||||
|     Items.registerSheet(SYSTEM_RDD, sheetClass, { | ||||
|       label: Misc.typeName('Item', sheetClass.ITEM_TYPE), | ||||
|       types: [sheetClass.ITEM_TYPE], | ||||
|       makeDefault: true | ||||
| @@ -42,7 +43,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet { | ||||
|   static get defaultOptions() { | ||||
|     return foundry.utils.mergeObject(super.defaultOptions, { | ||||
|       classes: [SYSTEM_RDD, "sheet", "item"], | ||||
|       template: RdDItemSheetV1.defaultTemplate(RdDItemSheetV1.ITEM_TYPE), | ||||
|       template: RdDItemSheet.defaultTemplate(RdDItemSheet.ITEM_TYPE), | ||||
|       width: 550, | ||||
|       height: 550 | ||||
|     }, { inplace: false }); | ||||
| @@ -50,7 +51,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet { | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   get template() { | ||||
|     return RdDItemSheetV1.defaultTemplate(this.item.type); | ||||
|     return RdDItemSheet.defaultTemplate(this.item.type); | ||||
|   } | ||||
|  | ||||
|   get title() { | ||||
| @@ -100,7 +101,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet { | ||||
|       description: await RdDTextEditor.enrichHTML(this.item.system.description, this.item), | ||||
|       descriptionmj: await RdDTextEditor.enrichHTML(this.item.system.descriptionmj, this.item), | ||||
|       isComestible: this.item.getUtilisationCuisine(), | ||||
|       options: RdDSheetUtility.mergeDocumentRights({}, this.item, this.isEditable), | ||||
|       options: RdDSheetUtility.mergeDocumentRights(this.options, this.item, this.isEditable), | ||||
|       competences: await SystemCompendiums.getCompetences(ACTOR_TYPES.personnage), | ||||
|       categories: RdDItem.getCategories(this.item.type), | ||||
|     } | ||||
| @@ -263,7 +264,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet { | ||||
|   _updateObject(event, formData) { | ||||
|     switch (this.item.type) { | ||||
|       case ITEM_TYPES.sort: | ||||
|         formData['system.bonuscase'] = RdDItemSort.bonuscasesToString(RdDItemSheetV1._listCaseTmr( | ||||
|         formData['system.bonuscase'] = RdDItemSort.bonuscasesToString(RdDItemSheet._listCaseTmr( | ||||
|           formData.caseTmrCoord, | ||||
|           formData.caseTmrBonus, | ||||
|           formData.caseTmrAdd | ||||
| @@ -313,7 +314,7 @@ export class RdDItemSheetV1 extends foundry.appv1.sheets.ItemSheet { | ||||
|  | ||||
|   async _onDrop(event) { | ||||
|     // Try to extract the dragData | ||||
|     let dragData = RdDItemSheetV1.$extractDragData(event); | ||||
|     let dragData = RdDItemSheet.$extractDragData(event); | ||||
|     if (!dragData) return false; | ||||
|     const allowed = Hooks.call("dropActorSheetData", this.actor, this, dragData); | ||||
|     if (allowed === false) return false; | ||||
|   | ||||
| @@ -16,10 +16,13 @@ export const VOIES_DRACONIC = [ | ||||
| /* -------------------------------------------- */ | ||||
| export class RdDItemSort extends Item { | ||||
|   static preloadHandlebars() { | ||||
|     Handlebars.registerHelper('itemSort-spaceIfText', val => RdDItemSort.addSpaceToNonNumeric(val)) | ||||
|     Handlebars.registerHelper('itemSort-codeDraconic', voie => RdDItemSort.getCode(voie)) | ||||
|     Handlebars.registerHelper('itemSort-shortDraconic', voie => RdDItemSort.getShortVoie(voie)) | ||||
|     Handlebars.registerHelper('itemSort-diffReve', sort => RdDItemSort.diffReve(sort)) | ||||
|     Handlebars.registerHelper('itemSort-coutReve', sort => RdDItemSort.coutReve(sort)) | ||||
|   } | ||||
|  | ||||
|   static addSpaceToNonNumeric(value) { | ||||
|     return Number.isNumeric(value) || ['-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(String(value).charAt[0]) ? value : ' ' + RdDItemSort.toVar(value) | ||||
|   } | ||||
|  | ||||
|   static lancements(sort) { return sort?.system.lancements.length ?? 0 } | ||||
| @@ -40,46 +43,19 @@ export class RdDItemSort extends Item { | ||||
|     return value ? value.replace('variable', 'var') : '' | ||||
|   } | ||||
|  | ||||
|   static isSortOnCoord(sort, coord) { | ||||
|     let tmr = TMRUtility.getTMR(coord) | ||||
|     const caseTMR = sort.system.caseTMR.toLowerCase(); | ||||
|     const caseTMRspeciale = sort.system.caseTMRspeciale.toLowerCase(); | ||||
|  | ||||
|     return caseTMR.includes('variable') | ||||
|       || caseTMRspeciale.includes('variable') | ||||
|       || (caseTMR == tmr.type) | ||||
|       || (caseTMR.includes('special') && caseTMRspeciale.includes(coord.toLowerCase())) | ||||
|   } | ||||
|  | ||||
|   static getCaseTMR(sort) { | ||||
|     const caseTMR = sort.system.caseTMR.toLowerCase(); | ||||
|     const caseTMRspeciale = sort.system.caseTMRspeciale.toLowerCase(); | ||||
|     if (caseTMR.includes('variable') || caseTMRspeciale.includes('variable') || caseTMR.includes('special')) { | ||||
|       return sort.system.caseTMRspeciale | ||||
|     } | ||||
|     return sort.system.caseTMR | ||||
|   } | ||||
|  | ||||
|  | ||||
|   static diffReve(sort) { return RdDItemSort.toVar((sort.system.difficulte.match(/\-?(\d)+/) ? 'R' : 'R ') + sort.system.difficulte) } | ||||
|   static coutReve(sort) { return RdDItemSort.toVar((sort.system.ptreve.match(/(\d)+\+?/) ? 'r' : 'r ') + sort.system.ptreve) } | ||||
|   static getDraconicsSort(competencesDraconic, sort) { | ||||
|     // se baser sur la voie du sort? | ||||
|     switch (Grammar.toLowerCaseNoAccent(sort.name)) { | ||||
|       case "lecture d'aura": | ||||
|       case "detection d'aura": | ||||
|         return competencesDraconic | ||||
|         return competencesDraconic; | ||||
|       case "annulation de magie": | ||||
|         return competencesDraconic.filter(it => !RdDItemCompetence.isThanatos(it)) | ||||
|         return competencesDraconic.filter(it => !RdDItemCompetence.isThanatos(it)); | ||||
|     } | ||||
|     const voies = sort.system.draconic.split('/') | ||||
|     return voies.map(voie => RdDItemCompetence.getVoieDraconic(competencesDraconic, voie)) | ||||
|   } | ||||
|  | ||||
|   static getBestDraconicSort(competencesDraconic, sort) { | ||||
|     return RdDItemSort.getDraconicsSort(competencesDraconic, sort).sort(Misc.descending(it => it.system.niveau)).find(it => true) | ||||
|   } | ||||
|  | ||||
|   static getOrdreCode(code) { | ||||
|     return (VOIES_DRACONIC.find(it => it.code == code)?.ordre ?? '?') | ||||
|   } | ||||
| @@ -116,7 +92,7 @@ export class RdDItemSort extends Item { | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   static isCoutVariable(sort) { | ||||
|     return sort && !Number.isInteger(sort.system.ptreve) && (sort.system.ptreve.toLowerCase() == "variable" || sort.system.ptreve.indexOf("+") >= 0); | ||||
|     return sort && (sort.system.ptreve.toLowerCase() == "variable" || sort.system.ptreve.indexOf("+") >= 0); | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   | ||||
| @@ -1,8 +1,7 @@ | ||||
| import { ITEM_TYPES } from "./constants.js"; | ||||
|  | ||||
| import { DialogItemVente } from "./achat-vente/dialog-item-vente.js"; | ||||
| import { Grammar } from "./grammar.js"; | ||||
| import { Misc } from "./misc.js"; | ||||
| import { DialogItemVente } from "./achat-vente/dialog-item-vente.js"; | ||||
| import { RdDTimestamp } from "./time/rdd-timestamp.js"; | ||||
| import { RdDUtility } from "./rdd-utility.js"; | ||||
| import { SystemCompendiums } from "./settings/system-compendiums.js"; | ||||
| @@ -79,13 +78,10 @@ export const defaultItemImg = { | ||||
|   souffle: "systems/foundryvtt-reve-de-dragon/icons/souffle_dragon.webp", | ||||
|   tarot: "systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.webp", | ||||
|   tete: "systems/foundryvtt-reve-de-dragon/icons/tete_dragon.webp", | ||||
|   monnaie:"systems/foundryvtt-reve-de-dragon/icons/objets/piece_etain_poisson.webp", | ||||
|   munition: "systems/foundryvtt-reve-de-dragon/icons/objets/fleche.webp" | ||||
| } | ||||
|  | ||||
| /* -------------------------------------------- */ | ||||
| export class RdDItem extends Item { | ||||
|    | ||||
|   static get defaultIcon() { | ||||
|     return undefined; | ||||
|   } | ||||
| @@ -97,12 +93,12 @@ export class RdDItem extends Item { | ||||
|   static isFieldInventaireModifiable(type, field) { | ||||
|     switch (field) { | ||||
|       case 'quantite': | ||||
|         if (ITEM_TYPES.conteneur == type) { | ||||
|         if ([ITEM_TYPES.conteneur].includes(type)) { | ||||
|           return false; | ||||
|         } | ||||
|         break; | ||||
|       case 'cout': | ||||
|         if (ITEM_TYPES.monnaie == type) { | ||||
|         if ([ITEM_TYPES.monnaie].includes(type)) { | ||||
|           return game.user.isGM; | ||||
|         } | ||||
|         break; | ||||
|   | ||||
| @@ -1,8 +1,9 @@ | ||||
| import { ACTOR_TYPES } from "../constants.js" | ||||
| import { Misc } from "../misc.js" | ||||
| import { RdDSheetUtility } from "../rdd-sheet-utility.js" | ||||
| import { RdDUtility } from "../rdd-utility.js" | ||||
|  | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * TODO: | ||||
|  * options.editable ? | ||||
| @@ -13,21 +14,22 @@ const _SPACEHOLDER = { placeholder: true } | ||||
| const _VENDRE = { | ||||
|   code: 'item-vendre', label: 'Vendre ou donner', icon: it => 'fa-solid fa-comments-dollar', | ||||
|   filter: it => Misc.toInt(it.system.quantite) > 0, | ||||
|   optionsFilter: options => options.editable, | ||||
|   action: (item, actor) => item.proposerVente() | ||||
| } | ||||
| const _ACHETER = { | ||||
|   code: 'item-acheter', label: 'Acheter', icon: it => 'fa-regular fa-coins', | ||||
|   filter: it => Misc.toInt(it.system.quantite) > 0 && it.parent?.type == ACTOR_TYPES.commerce, | ||||
|   action: (item, actor) => actor.vente(item) | ||||
| const _ACHAT_SERVICE = { | ||||
|   code: 'item-service-acheter', label: 'Acheter', icon: it => 'fa-regular fa-coins', | ||||
|   //filter: it => Misc.toInt(it.system.quantite) > 0, | ||||
|   //optionsFilter: options => options.editable, | ||||
|   //action: (item, actor) => item.proposerVente() | ||||
| } | ||||
| const _MONTRER = { | ||||
|   code: 'item-montrer', label: 'Montrer', icon: it => 'fa-solid fa-comment', | ||||
|   allowLimited: true, | ||||
|   action: (item, actor) => item.postItemToChat() | ||||
| } | ||||
| const _SPLIT = { | ||||
|   code: 'item-split', label: 'Séparer le goupe', icon: it => 'fa-solid fa-unlink', | ||||
|   filter: it => Misc.toInt(it.system.quantite) > 1 && it.parent?.type != ACTOR_TYPES.commerce, | ||||
|   filter: it => Misc.toInt(it.system.quantite) > 1, | ||||
|   action: (item, actor) => RdDSheetUtility.splitItem(item, actor) | ||||
| } | ||||
|  | ||||
| @@ -37,7 +39,7 @@ const _EDIT = { | ||||
| } | ||||
| const _DELETE = { | ||||
|   code: 'item-delete', label: 'Supprimer', icon: it => 'fa-solid fa-trash', | ||||
|   optionsFilter: options => options.isOwner, | ||||
|   optionsFilter: options => options.editable && options.isOwner, | ||||
|   action: (item, actor) => RdDUtility.confirmActorItemDelete(item, actor) | ||||
| } | ||||
| const _EQUIPER = { | ||||
| @@ -49,25 +51,30 @@ const _EQUIPER = { | ||||
| const _CUISINER = { | ||||
|   code: 'item-cuisiner', label: 'Cuisiner', icon: it => 'fa-solid fa-utensils', | ||||
|   filter: it => it.getUtilisation() == 'cuisine' && it.system.sust > 0, | ||||
|   optionsFilter: options => options.editable, | ||||
|   action: (item, actor) => actor.preparerNourriture(item) | ||||
| } | ||||
| const _MANGER_CRU = { | ||||
|   code: 'item-manger-cru', label: 'Manger cru', icon: it => 'fa-solid fa-drumstick-bite', | ||||
|   filter: it => it.getUtilisation() == 'cuisine' && it.system.sust > 0, | ||||
|   optionsFilter: options => options.editable, | ||||
|   action: (item, actor) => actor.mangerNourriture(item) | ||||
| } | ||||
| const _MANGER = { | ||||
|   code: 'item-manger', label: 'Manger', icon: it => 'fa-solid fa-utensils', | ||||
|   filter: it => !(it.system.boisson), | ||||
|   optionsFilter: options => options.editable, | ||||
|   action: (item, actor) => actor.mangerNourriture(item) | ||||
| } | ||||
| const _BOIRE = { | ||||
|   code: 'item-boire', label: 'Boire', icon: it => 'fa-solid fa-glass-water', | ||||
|   filter: it => it.system.boisson, | ||||
|   optionsFilter: options => options.editable, | ||||
|   action: (item, actor) => actor.mangerNourriture(item) | ||||
| } | ||||
| const _DECOCTION = { | ||||
|   code: 'item-decoction', label: 'Décoction', icon: it => 'fa-solid fa-flask-vial', | ||||
|   optionsFilter: options => options.editable, | ||||
|   action: (item, actor) => actor.fabriquerDecoctionHerbe(item) | ||||
| } | ||||
| const _OUVRIR = { | ||||
| @@ -77,12 +84,14 @@ const _OUVRIR = { | ||||
|  | ||||
| const _LIRE = { | ||||
|   code: 'item-lire', label: 'Lire', icon: it => 'fa-solid fa-book-open', | ||||
|   optionsFilter: options => options.editable, | ||||
|   action: (item, actor) => actor.actionLire(item) | ||||
| } | ||||
|  | ||||
| const _REFOULER = { | ||||
|   code: 'item-refouler', label: 'Refouler', icon: it => 'fa-solid fa-burst', | ||||
|   filter: it => it.system.refoulement > 0, | ||||
|   optionsFilter: options => options.editable, | ||||
|   action: (item, actor) => actor.actionRefoulement(item) | ||||
| } | ||||
|  | ||||
| @@ -93,7 +102,7 @@ const _SORT_RESERVE = { | ||||
| } | ||||
|  | ||||
| export const COMMON_ACTIONS = [_EQUIPER] | ||||
| export const DEFAULT_ACTIONS = [_ACHETER, _SPACEHOLDER, _SPLIT, _VENDRE, _MONTRER, _EDIT, _DELETE] | ||||
| export const DEFAULT_ACTIONS = [_SPACEHOLDER, _SPLIT, _VENDRE, _MONTRER, _EDIT, _DELETE] | ||||
|  | ||||
| export const ITEM_ACTIONS = { | ||||
|   faune: [_CUISINER, _MANGER_CRU], | ||||
| @@ -105,16 +114,17 @@ export const ITEM_ACTIONS = { | ||||
|   ombre: [_REFOULER], | ||||
|   plante: [_CUISINER, _MANGER_CRU], | ||||
|   queue: [_REFOULER], | ||||
|   sort: [_SORT_RESERVE] | ||||
|   sort: [_SORT_RESERVE], | ||||
|   service: [_ACHAT_SERVICE] | ||||
| } | ||||
|  | ||||
|  | ||||
| export class ItemAction { | ||||
|  | ||||
|   static applies(action, item, options) { | ||||
|     return action && item | ||||
|       && item.isActionAllowed(action.code) | ||||
|       && (!action.filter || action.filter(item)) | ||||
|       && (action.allowLimited || options.editable) | ||||
|       && (!action.optionsFilter || action.optionsFilter(options)) | ||||
|   } | ||||
|  | ||||
| @@ -126,10 +136,10 @@ export class ItemAction { | ||||
|   } | ||||
|  | ||||
|   static async onActionItem(event, actor, options) { | ||||
|     const code = $(event.currentTarget).data('code') | ||||
|     const item = RdDSheetUtility.getItem(event, actor) | ||||
|     const code = $(event.currentTarget).data('code') | ||||
|     const action = item?.itemActions().find(it => it.code == code) | ||||
|     if (action && ItemAction.applies(action, item, options)) { | ||||
|     if (action && (!action.optionsFilter || action.optionsFilter(options))) { | ||||
|       await action.action(item, actor) | ||||
|     } | ||||
|   } | ||||
|   | ||||
| @@ -55,10 +55,6 @@ export class RdDItemRace extends RdDItem { | ||||
|  | ||||
|   isMax(actor, code, value = undefined) { | ||||
|     const path = RdDCarac.carac(code)?.path | ||||
|     if (path == undefined) { | ||||
|       // cas des caractéristiques dérivées, pas de max | ||||
|       return false | ||||
|     } | ||||
|     if (value == undefined) { | ||||
|       value = path ? foundry.utils.getProperty(actor, path) : 0 | ||||
|     } | ||||
|   | ||||
| @@ -1,14 +1,14 @@ | ||||
| import { HtmlUtility } from "../html-utility.js"; | ||||
| import { RdDItemSheetV1 } from "../item-sheet.js"; | ||||
| import { RdDItemSheet } from "../item-sheet.js"; | ||||
| import { Misc } from "../misc.js"; | ||||
| import { RdDRaretes } from "./raretes.js"; | ||||
|  | ||||
| const TYPE_ITEMS_NATURELS = ["faune", "herbe", "plante", "ingredient"]; | ||||
|  | ||||
| export class RdDInventaireItemSheet extends RdDItemSheetV1 { | ||||
| export class RdDItemInventaireSheet extends RdDItemSheet { | ||||
|  | ||||
|   static get defaultOptions() { | ||||
|     return foundry.utils.mergeObject(RdDItemSheetV1.defaultOptions, { | ||||
|     return foundry.utils.mergeObject(RdDItemSheet.defaultOptions, { | ||||
|       tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "informations" }] | ||||
|     }, { inplace: false }) | ||||
|   } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import { RdDItemSheetV1 } from "../item-sheet.js"; | ||||
| import { RdDItemSheet } from "../item-sheet.js"; | ||||
|  | ||||
| export class RdDBlessureItemSheet extends RdDItemSheetV1 { | ||||
| export class RdDBlessureItemSheet extends RdDItemSheet { | ||||
|  | ||||
|   static get ITEM_TYPE() { return "blessure" }; | ||||
|  | ||||
|   | ||||
| @@ -2,9 +2,9 @@ import { RdDBaseActorSheet } from "../actor/base-actor-sheet.js"; | ||||
| import { ITEM_TYPES } from "../constants.js"; | ||||
| import { RdDSheetUtility } from "../rdd-sheet-utility.js"; | ||||
| import { RdDUtility } from "../rdd-utility.js"; | ||||
| import { RdDInventaireItemSheet } from "./sheet-base-inventaire.js"; | ||||
| import { RdDItemInventaireSheet } from "./sheet-base-inventaire.js"; | ||||
|  | ||||
| export class RdDConteneurItemSheet extends RdDInventaireItemSheet { | ||||
| export class RdDConteneurItemSheet extends RdDItemInventaireSheet { | ||||
|  | ||||
|   static get ITEM_TYPE() { return ITEM_TYPES.conteneur }; | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import { RdDInventaireItemSheet } from "./sheet-base-inventaire.js"; | ||||
| import { RdDItemInventaireSheet } from "./sheet-base-inventaire.js"; | ||||
|  | ||||
| export class RdDFauneItemSheet extends RdDInventaireItemSheet { | ||||
| export class RdDFauneItemSheet extends RdDItemInventaireSheet { | ||||
|  | ||||
|   static get ITEM_TYPE() { return "faune" }; | ||||
|  | ||||
| @@ -9,7 +9,7 @@ export class RdDFauneItemSheet extends RdDInventaireItemSheet { | ||||
|  | ||||
|     if (!this.options.editable) return; | ||||
|  | ||||
|     $(html).find("a.linked-actor-delete").click(async event => await this.onDeleteLinkedActor()); | ||||
|     html.find("a.linked-actor-delete").click(async event => await this.onDeleteLinkedActor()); | ||||
|   } | ||||
|  | ||||
|   async _onDropActor(event, dragData) { | ||||
|   | ||||
| @@ -2,9 +2,9 @@ import { ITEM_TYPES } from "../constants.js"; | ||||
| import { DialogEnchanter } from "../enchantement/dialog-enchanter.js"; | ||||
| import { RdDTimestamp } from "../time/rdd-timestamp.js"; | ||||
| import { RdDItemGemme } from "./gemme.js"; | ||||
| import { RdDInventaireItemSheet } from "./sheet-base-inventaire.js"; | ||||
| import { RdDItemInventaireSheet } from "./sheet-base-inventaire.js"; | ||||
|  | ||||
| export class RdDGemmeItemSheet extends RdDInventaireItemSheet { | ||||
| export class RdDGemmeItemSheet extends RdDItemInventaireSheet { | ||||
|  | ||||
|   static get ITEM_TYPE() { return ITEM_TYPES.gemme }; | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import { RdDInventaireItemSheet } from "./sheet-base-inventaire.js"; | ||||
| import { RdDItemInventaireSheet } from "./sheet-base-inventaire.js"; | ||||
|  | ||||
| export class RdDHerbeItemSheet extends RdDInventaireItemSheet { | ||||
| export class RdDHerbeItemSheet extends RdDItemInventaireSheet { | ||||
|  | ||||
|   static get ITEM_TYPE() { return "herbe" }; | ||||
| } | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| import { RdDInventaireItemSheet } from "./sheet-base-inventaire.js"; | ||||
| import { RdDItemInventaireSheet } from "./sheet-base-inventaire.js"; | ||||
|  | ||||
| export class RdDIngredientItemSheet extends RdDInventaireItemSheet { | ||||
| export class RdDIngredientItemSheet extends RdDItemInventaireSheet { | ||||
|   static get ITEM_TYPE() { return "ingredient" }; | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import { RdDInventaireItemSheet } from "./sheet-base-inventaire.js"; | ||||
| import { RdDItemInventaireSheet } from "./sheet-base-inventaire.js"; | ||||
|  | ||||
| export class RdDPlanteItemSheet extends RdDInventaireItemSheet { | ||||
| export class RdDPlanteItemSheet extends RdDItemInventaireSheet { | ||||
|  | ||||
|   static get ITEM_TYPE() { return "plante" }; | ||||
|  | ||||
|   | ||||
| @@ -2,10 +2,10 @@ import { ITEM_TYPES } from "../constants.js"; | ||||
| import { DialogEnchanter } from "../enchantement/dialog-enchanter.js"; | ||||
| import { RdDTimestamp } from "../time/rdd-timestamp.js"; | ||||
| import { RdDItemPotion } from "./potion.js"; | ||||
| import { RdDInventaireItemSheet } from "./sheet-base-inventaire.js"; | ||||
| import { RdDItemInventaireSheet } from "./sheet-base-inventaire.js"; | ||||
|  | ||||
|  | ||||
| export class RdDPotionItemSheet extends RdDInventaireItemSheet { | ||||
| export class RdDPotionItemSheet extends RdDItemInventaireSheet { | ||||
|  | ||||
|   static get ITEM_TYPE() { return ITEM_TYPES.potion }; | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| import { RdDRencontre } from "./rencontre.js"; | ||||
| import { RdDItemSheetV1 } from "../item-sheet.js"; | ||||
| import { RdDItemSheet } from "../item-sheet.js"; | ||||
|  | ||||
| export class RdDRencontreItemSheet extends RdDItemSheetV1 { | ||||
| export class RdDRencontreItemSheet extends RdDItemSheet { | ||||
|    | ||||
|   static get ITEM_TYPE() { return "rencontre" }; | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import { RdDItemSheetV1 } from "../item-sheet.js"; | ||||
| import { RdDItemSheet } from "../item-sheet.js"; | ||||
|  | ||||
| export class RdDServiceItemSheet extends RdDItemSheetV1 { | ||||
| export class RdDServiceItemSheet extends RdDItemSheet { | ||||
|  | ||||
|   static get ITEM_TYPE() { return "service" }; | ||||
|  | ||||
|   | ||||
| @@ -1,12 +1,12 @@ | ||||
| import { RdDItemSheetV1 } from "../item-sheet.js"; | ||||
| import { RdDItemSheet } from "../item-sheet.js"; | ||||
| import { RdDItemSigneDraconique } from "./signedraconique.js"; | ||||
| import { TMRUtility } from "../tmr-utility.js"; | ||||
|  | ||||
| /** | ||||
|  * Item sheet pour signes draconiques | ||||
|  * @extends {RdDItemSheetV1} | ||||
|  * @extends {RdDItemSheet} | ||||
|  */ | ||||
| export class RdDSigneDraconiqueItemSheet extends RdDItemSheetV1 { | ||||
| export class RdDSigneDraconiqueItemSheet extends RdDItemSheet { | ||||
|  | ||||
|   static get ITEM_TYPE() { return "signedraconique" } | ||||
|  | ||||
| @@ -36,9 +36,9 @@ export class RdDSigneDraconiqueItemSheet extends RdDItemSheetV1 { | ||||
|  | ||||
|     if (!this.options.editable) return; | ||||
|  | ||||
|     $(html).find(".signe-aleatoire").click(async event => await this.setSigneAleatoire()); | ||||
|     $(html).find("input.select-tmr").change(async event => await this.onSelectTmr(event)); | ||||
|     $(html).find(".signe-xp-sort").change(async event => await this.onValeurXpSort(event.currentTarget.attributes['data-typereussite']?.value, Number(event.currentTarget.value))); | ||||
|     html.find(".signe-aleatoire").click(async event => await this.setSigneAleatoire()); | ||||
|     html.find("input.select-tmr").change(async event => await this.onSelectTmr(event)); | ||||
|     html.find(".signe-xp-sort").change(async event => await this.onValeurXpSort(event.currentTarget.attributes['data-typereussite']?.value, Number(event.currentTarget.value))); | ||||
|   } | ||||
|  | ||||
|   async setSigneAleatoire() { | ||||
|   | ||||
| @@ -3,10 +3,10 @@ import { SYSTEM_RDD } from "../constants.js"; | ||||
| import { Misc } from "../misc.js"; | ||||
|  | ||||
|  | ||||
| export class RdDJournalSheet extends foundry.appv1.sheets.JournalTextPageSheet { | ||||
| export class RdDJournalSheet extends JournalTextPageSheet { | ||||
|   static register() { | ||||
|     foundry.applications.apps.DocumentSheetConfig.unregisterSheet(JournalEntryPage, "core", foundry.appv1.sheets.JournalTextPageSheet) | ||||
|     foundry.applications.apps.DocumentSheetConfig.registerSheet(JournalEntryPage, | ||||
|     DocumentSheetConfig.unregisterSheet(JournalEntryPage, "core", JournalTextPageSheet) | ||||
|     DocumentSheetConfig.registerSheet(JournalEntryPage, | ||||
|       SYSTEM_RDD, | ||||
|       RdDJournalSheet, { | ||||
|       types: ["text"], | ||||
|   | ||||
| @@ -247,7 +247,7 @@ class _10_2_10_DesirLancinant_IdeeFixe extends Migration { | ||||
|     await this.applyItemsUpdates(items => items | ||||
|       .filter(it => ['queue', 'ombre'].includes(it.type)) | ||||
|       .map(it => this.migrateQueue(it)) | ||||
|     ) | ||||
|     ); | ||||
|   } | ||||
| } | ||||
|  | ||||
| @@ -631,37 +631,13 @@ class _12_0_38_TachesEcriture extends Migration { | ||||
|  | ||||
|   async migrate() { | ||||
|     await this.applyItemsUpdates(items => items | ||||
|       .filter(it => [ITEM_TYPES.tache, ITEM_TYPES.livre, ITEM_TYPES.oeuvre, ITEM_TYPES.meditation].includes(it.type)) | ||||
|       .filter(it => Grammar.equalsInsensitive(it.system.competence, 'ecriture')) | ||||
|       .filter(it => [ITEM_TYPES.tache, ITEM_TYPES.livre, ITEM_TYPES.oeuvre, ITEM_TYPES.meditation].includes(it.type) ) | ||||
|       .filter(it => it.system.competence == 'Ecriture') | ||||
|       .map(it => { return { _id: it.id, 'system.competence': 'Écriture' } }) | ||||
|     ) | ||||
|   } | ||||
| } | ||||
|  | ||||
| class _13_0_4_FixReveActuel extends Migration { | ||||
|   get code() { return "fix-reve-actuel" } | ||||
|   get version() { return "13.0.4" } | ||||
|  | ||||
|   async migrate() { | ||||
|     game.actors.forEach(it => it.update({ 'system.carac.-=reve-actuel': null })) | ||||
|   } | ||||
| } | ||||
|  | ||||
| class _13_0_7_FixNiveauOeuvres extends Migration { | ||||
|   get code() { return "fix-niveau-oeuvres" } | ||||
|   get version() { return "13.0.7" } | ||||
|  | ||||
|   async migrate() { | ||||
|     await this.applyItemsUpdates(items => items | ||||
|       .filter(it => [ITEM_TYPES.musique, ITEM_TYPES.chant, ITEM_TYPES.danse, ITEM_TYPES.recettecuisine].includes(it.type)) | ||||
|       .map(it => { | ||||
|         const niveau = isNaN(it.system.niveau) ? 0 : parseInt(it.system.niveau) | ||||
|         return { _id: it.id, 'system.niveau': niveau } | ||||
|       }) | ||||
|     ) | ||||
|   } | ||||
| } | ||||
|  | ||||
| export class Migrations { | ||||
|   static getMigrations() { | ||||
|     return [ | ||||
| @@ -684,9 +660,7 @@ export class Migrations { | ||||
|       new _12_0_26_MigrationVoieSorts(), | ||||
|       new _12_0_32_MigrationRaces(), | ||||
|       new _12_0_37_MigrationAlchimieEtat(), | ||||
|       new _12_0_38_TachesEcriture(), | ||||
|       new _13_0_4_FixReveActuel(), | ||||
|       new _13_0_7_FixNiveauOeuvres(), | ||||
|       new _12_0_38_TachesEcriture() | ||||
|     ]; | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -38,12 +38,6 @@ export class Misc { | ||||
|     return (a, b) => Number(a) + Number(b); | ||||
|   } | ||||
|  | ||||
|   static and(predicates) { | ||||
|     return value => predicates.map(predicate => predicate(value)) | ||||
|       .reduce((v1, v2) => v1 && v2, true); | ||||
|   } | ||||
|  | ||||
|  | ||||
|   static ascending(orderFunction = x => x) { | ||||
|     return (a, b) => Misc.sortingBy(orderFunction(a), orderFunction(b)); | ||||
|   } | ||||
| @@ -66,11 +60,6 @@ export class Misc { | ||||
|   static arrayOrEmpty(items) { | ||||
|     return items?.length ? items : []; | ||||
|   } | ||||
|  | ||||
|   static findOrFirst(list, predicate) { | ||||
|     return list.find(predicate) ?? list[0] | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * Converts the value to an integer, or to 0 if undefined/null/not representing integer | ||||
|    * @param {*} value value to convert to an integer using parseInt | ||||
| @@ -86,17 +75,13 @@ export class Misc { | ||||
|     return Math.round(num * power10n) / power10n; | ||||
|   } | ||||
|  | ||||
|  | ||||
|   static getFractionOneN(divider) { | ||||
|     if (!divider || divider == 1) { | ||||
|       return 1 | ||||
|   static getFractionHtml(diviseur) { | ||||
|     if (!diviseur || diviseur <= 1) return undefined; | ||||
|     switch (diviseur || 1) { | ||||
|       case 2: return '½'; | ||||
|       case 4: return '¼'; | ||||
|       default: return '1/' + diviseur; | ||||
|     } | ||||
|     switch (divider) { | ||||
|       case 2: return '½' | ||||
|       case 4: return '¼' | ||||
|       case 8: return '⅛' | ||||
|     } | ||||
|     return `1/${divider}` | ||||
|   } | ||||
|  | ||||
|   static indexLowercase(list) { | ||||
| @@ -231,7 +216,7 @@ export class Misc { | ||||
|   static isFirstConnectedGM() { | ||||
|     return game.user == Misc.firstConnectedGM(); | ||||
|   } | ||||
|  | ||||
|    | ||||
|   static hasConnectedGM() { | ||||
|     return Misc.firstConnectedGM(); | ||||
|   } | ||||
| @@ -280,7 +265,7 @@ export class Misc { | ||||
|     const subset = elements.filter(options.preFilter) | ||||
|       .filter(it => Grammar.toLowerCaseNoAccent(options.mapper(it))?.includes(value)) | ||||
|       .sort(Misc.ascending(it => options.mapper(it))) | ||||
|     if (subset.length == 0) { | ||||
|     if (subset.length == 0 && options?.onMessage) { | ||||
|       options.onMessage(`Pas de ${options.description} correspondant à ${value}`); | ||||
|     } | ||||
|     return subset; | ||||
|   | ||||
| @@ -1,3 +0,0 @@ | ||||
| export { default as RdDModelMonnaie } from "./monnaie.mjs" | ||||
| export { default as RdDModelMunition } from "./munition.mjs" | ||||
| export { default as RdDModelTarot } from "./tarot.mjs" | ||||
| @@ -1,10 +0,0 @@ | ||||
| import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../common/_module.mjs"; | ||||
|  | ||||
| export default class RdDModelMonnaie extends foundry.abstract.TypeDataModel { | ||||
|   static defineSchema() { | ||||
|     return Object.assign({}, | ||||
|       TEMPLATE_DESCRIPTION.fields(), | ||||
|       TEMPLATE_INVENTAIRE.fields() | ||||
|     ) | ||||
|   } | ||||
| } | ||||
| @@ -1,10 +0,0 @@ | ||||
| import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../common/_module.mjs"; | ||||
|  | ||||
| export default class RdDModelMunition extends foundry.abstract.TypeDataModel { | ||||
|   static defineSchema() { | ||||
|     return Object.assign({}, | ||||
|       TEMPLATE_DESCRIPTION.fields(), | ||||
|       TEMPLATE_INVENTAIRE.fields() | ||||
|     ) | ||||
|   } | ||||
| } | ||||
| @@ -1,18 +0,0 @@ | ||||
| import { TEMPLATE_DESCRIPTION } from "../common/_module.mjs"; | ||||
| import { DECIMAL, INTEGER, INTEGER_SIGNED, MODEL_ARRAY, STRING } from "../common/field-types.mjs" | ||||
|  | ||||
| const fields = foundry.data.fields | ||||
|  | ||||
| export default class RdDModelTarot extends foundry.abstract.TypeDataModel { | ||||
|   static defineSchema() { | ||||
|     let tarotFields = { | ||||
|       concept : new fields.StringField({ label: "Concept", initial: "", ...STRING }), | ||||
|       aspect : new fields.StringField({ label: "Aspect", initial: "", ...STRING }), | ||||
|       frequence : new fields.NumberField({ label: "Fréquence", initial: 1, ...INTEGER })       | ||||
|     } | ||||
|     return Object.assign({}, | ||||
|       TEMPLATE_DESCRIPTION.fields(), | ||||
|       tarotFields | ||||
|     ) | ||||
|   } | ||||
| } | ||||
| @@ -1,23 +1,21 @@ | ||||
| import { RdDCarac } from "./rdd-carac.js"; | ||||
| import { RdDPossession } from "./rdd-possession.js"; | ||||
|  | ||||
| const conditionsTactiques = [ | ||||
|   { key: '', label: '', dmg: 0, attaque: 0, parade: 0, esquive: true, isTactique: false }, | ||||
|   { key: 'normale', label: 'Attaque normale', dmg: 0, attaque: 0, parade: 0, esquive: true, isTactique: true }, | ||||
|   { key: 'charge', label: 'Charge', dmg: 2, attaque: 4, parade: -4, esquive: false, isTactique: true }, | ||||
|   { key: 'feinte', label: 'Feinte', dmg: 1, attaque: 1, parade: 0, esquive: true, isTactique: true }, | ||||
|   { key: 'pret', label: 'prêt', dmg: 0, attaque: 0, parade: 0, esquive: true, isTactique: false }, | ||||
|   { key: 'demi', label: 'Demi-surprise', dmg: 1, attaque: 0, parade: 0, esquive: true, isTactique: false }, | ||||
|   { key: 'totale', label: 'Surprise totale', dmg: 10, attaque: 6, parade: 0, esquive: true, isTactique: false }, | ||||
|   { type: '', descr: '', dmg: 0, attaque: 0, parade: 0, esquive: true }, | ||||
|   { type: 'charge', descr: 'Charge', dmg: 2, attaque: 4, parade: -4, esquive: false }, | ||||
|   { type: 'feinte', descr: 'Feinte', dmg: 1, attaque: 1, parade: 0, esquive: true }, | ||||
|   { type: 'pret', descr: 'prêt', dmg: 0, attaque: 0, parade: 0, esquive: true }, | ||||
|   { type: 'demi', descr: 'Demi-surprise', dmg: 1, attaque: 0, parade: 0, esquive: true }, | ||||
|   { type: 'totale', descr: 'Surprise totale', dmg: 10, attaque: 6, parade: 0, esquive: true }, | ||||
| ]; | ||||
|  | ||||
| /* -------------------------------------------- */ | ||||
| export class RdDBonus { | ||||
|   static get tactiques(){ | ||||
|     return conditionsTactiques.filter(it => it.isTactique) | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   static find(condition) { | ||||
|     return conditionsTactiques.find(e => e.key == condition) || conditionsTactiques[0]; | ||||
|     return conditionsTactiques.find(e => e.type == condition) || conditionsTactiques.find(e => e.type == 'pret'); | ||||
|   } | ||||
|  | ||||
|  | ||||
| @@ -34,7 +32,7 @@ export class RdDBonus { | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   static dmg(rollData, actor, isEntiteIncarnee = false) { | ||||
|     const dmgArme = RdDBonus.dmgArme(rollData.arme, rollData.arme?.system.dommagesReels) | ||||
|     const dmgArme = RdDBonus.dmgArme(rollData.arme) | ||||
|     let dmg = { | ||||
|       total: 0, | ||||
|       dmgArme: dmgArme, | ||||
| @@ -51,35 +49,31 @@ export class RdDBonus { | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   static description(condition) { | ||||
|     return RdDBonus.find(condition).label | ||||
|     return RdDBonus.find(condition).descr; | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   static dmgBonus(condition) { | ||||
|     return RdDBonus.find(condition).dmg | ||||
|     return RdDBonus.find(condition).dmg; | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   static bonusAttaque(condition) { | ||||
|     return RdDBonus.find(condition).attaque | ||||
|     return RdDBonus.find(condition).attaque; | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   static _calculMortalite(rollData, isEntiteIncarnee) { | ||||
|     return RdDBonus.mortalite(rollData.dmg?.mortalite, rollData.arme?.system.mortalite, isEntiteIncarnee) | ||||
|   } | ||||
|  | ||||
|   static mortalite(mortaliteSelect, mortaliteArme, isEntiteIncarnee) { | ||||
|     return isEntiteIncarnee ? "entiteincarnee" | ||||
|       : mortaliteSelect | ||||
|       ?? mortaliteArme | ||||
|       : rollData.dmg?.mortalite | ||||
|       ?? rollData.arme?.system.mortalite | ||||
|       ?? "mortel"; | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   static dmgArme(arme, dommagesMain) { | ||||
|   static dmgArme(arme) { | ||||
|     if (arme) { | ||||
|       let dmgBase = dommagesMain ?? Number(arme.system.dommages ?? 0); | ||||
|       let dmgBase = arme.system.dommagesReels ?? Number(arme.system.dommages ?? 0); | ||||
|       //Le bonus dégats magiques ne peut pas faire dépasser le bonus de l'arme (cf p.278) | ||||
|       return dmgBase + Math.min(dmgBase, arme.system.magique ? arme.system.ecaille_efficacite : 0); | ||||
|     } | ||||
| @@ -98,8 +92,8 @@ export class RdDBonus { | ||||
|       return 0 | ||||
|     } | ||||
|     switch (categorie) { | ||||
|       case "(tir)": case "tir": return 0 | ||||
|       case "(lancer)": case "lancer": return Math.max(0, Math.min(dmgArme, dmgActor)); | ||||
|       case "tir": return 0; | ||||
|       case "lancer": return Math.max(0, Math.min(dmgArme, dmgActor)); | ||||
|     } | ||||
|     return dmgActor; | ||||
|   } | ||||
|   | ||||
| @@ -37,37 +37,21 @@ const TABLE_CARACTERISTIQUES_DERIVEES = { | ||||
|   32: { xp: 180, niveau: 11, poids: "1501-2000", poidsMin: 1501, poidsMax: 2000, plusdom: +11, sconst: 10, sust: 17 } | ||||
| }; | ||||
|  | ||||
| export const CARACS = { | ||||
|   TAILLE: 'taille', | ||||
|   APPARENCE: 'apparence', | ||||
|   CONSTITUTION: 'constitution', | ||||
|   FORCE: 'force', | ||||
|   AGILITE: 'agilite', | ||||
|   DEXTERITE: 'dexterite', | ||||
|   VUE: 'vue', | ||||
|   OUIE: 'ouie', | ||||
|   ODORATGOUT: 'odoratgout', | ||||
|   VOLONTE: 'volonte', | ||||
|   INTELLECT: 'intellect', | ||||
|   EMPATHIE: 'empathie', | ||||
|   REVE: 'reve', | ||||
|   CHANCE: 'chance', | ||||
| } | ||||
| export const LIST_CARAC_PERSONNAGE = { | ||||
|   [CARACS.TAILLE]: { code: CARACS.TAILLE, label: 'Taille', isCarac: true, path: 'system.carac.taille.value' }, | ||||
|   [CARACS.APPARENCE]: { code: CARACS.APPARENCE, label: 'Apparence', isCarac: true, path: 'system.carac.apparence.value' }, | ||||
|   [CARACS.CONSTITUTION]: { code: CARACS.CONSTITUTION, label: 'Constitution', isCarac: true, path: 'system.carac.constitution.value' }, | ||||
|   [CARACS.FORCE]: { code: CARACS.FORCE, label: 'Force', isCarac: true, path: 'system.carac.force.value' }, | ||||
|   [CARACS.AGILITE]: { code: CARACS.AGILITE, label: 'Agilité', isCarac: true, path: 'system.carac.agilite.value' }, | ||||
|   [CARACS.DEXTERITE]: { code: CARACS.DEXTERITE, label: 'Dextérité', isCarac: true, path: 'system.carac.dexterite.value' }, | ||||
|   [CARACS.VUE]: { code: CARACS.VUE, label: 'Vue', isCarac: true, path: 'system.carac.vue.value' }, | ||||
|   [CARACS.OUIE]: { code: CARACS.OUIE, label: 'Ouïe', isCarac: true, path: 'system.carac.ouie.value' }, | ||||
|   [CARACS.ODORATGOUT]: { code: CARACS.ODORATGOUT, label: 'Odorat-Goût', isCarac: true, path: 'system.carac.odoratgout.value' }, | ||||
|   [CARACS.VOLONTE]: { code: CARACS.VOLONTE, label: 'Volonté', isCarac: true, path: 'system.carac.volonte.value' }, | ||||
|   [CARACS.INTELLECT]: { code: CARACS.INTELLECT, label: 'Intellect', isCarac: true, path: 'system.carac.intellect.value' }, | ||||
|   [CARACS.EMPATHIE]: { code: CARACS.EMPATHIE, label: 'Empathie', isCarac: true, path: 'system.carac.empathie.value' }, | ||||
|   [CARACS.REVE]: { code: CARACS.REVE, label: 'Rêve', isCarac: true, path: 'system.carac.reve.value' }, | ||||
|   [CARACS.CHANCE]: { code: CARACS.CHANCE, label: 'Chance', isCarac: true, path: 'system.carac.chance.value' }, | ||||
|   'taille': { code: 'taille', label: 'Taille', isCarac: true, path: 'system.carac.taille.value' }, | ||||
|   'apparence': { code: 'apparence', label: 'Apparence', isCarac: true, path: 'system.carac.apparence.value' }, | ||||
|   'constitution': { code: 'constitution', label: 'Constitution', isCarac: true, path: 'system.carac.constitution.value' }, | ||||
|   'force': { code: 'force', label: 'Force', isCarac: true, path: 'system.carac.force.value' }, | ||||
|   'agilite': { code: 'agilite', label: 'Agilité', isCarac: true, path: 'system.carac.agilite.value' }, | ||||
|   'dexterite': { code: 'dexterite', label: 'Dextérité', isCarac: true, path: 'system.carac.dexterite.value' }, | ||||
|   'vue': { code: 'vue', label: 'Vue', isCarac: true, path: 'system.carac.vue.value' }, | ||||
|   'ouie': { code: 'ouie', label: 'Ouïe', isCarac: true, path: 'system.carac.ouie.value' }, | ||||
|   'odoratgout': { code: 'odoratgout', label: 'Odorat-Goût', isCarac: true, path: 'system.carac.odoratgout.value' }, | ||||
|   'volonte': { code: 'volonte', label: 'Volonté', isCarac: true, path: 'system.carac.volonte.value' }, | ||||
|   'intellect': { code: 'intellect', label: 'Intellect', isCarac: true, path: 'system.carac.intellect.value' }, | ||||
|   'empathie': { code: 'empathie', label: 'Empathie', isCarac: true, path: 'system.carac.empathie.value' }, | ||||
|   'reve': { code: 'reve', label: 'Rêve', isCarac: true, path: 'system.carac.reve.value' }, | ||||
|   'chance': { code: 'chance', label: 'Chance', isCarac: true, path: 'system.carac.chance.value' }, | ||||
|   'protection': { code: 'protection', label: 'Protection naturelle', isCarac: false, path: 'system.attributs.protection.value' }, | ||||
|   'beaute': { code: 'beaute', label: 'Beauté', isCarac: false, path: 'system.background.beaute.value' } | ||||
| } | ||||
| @@ -85,7 +69,7 @@ const LIST_CARAC_DERIVEE = { | ||||
|   'reve-actuel': { code: "reve-actuel", label: 'Rêve actuel', path: 'system.reve.reve.value' }, | ||||
| } | ||||
|  | ||||
| export const LIST_CARAC_ROLL = Object.values(LIST_CARAC_PERSONNAGE).filter(it => it.isCarac && it.code != 'taille') | ||||
| const LIST_CARAC_ROLL = Object.values(LIST_CARAC_PERSONNAGE).filter(it => it.isCarac && it.code != 'taille') | ||||
|   .concat(Object.values(LIST_CARAC_AUTRES)) | ||||
|   .concat(Object.values(LIST_CARAC_DERIVEE)) | ||||
|  | ||||
| @@ -111,41 +95,27 @@ export class RdDCarac { | ||||
|     return Object.values(LIST_CARAC_PERSONNAGE).filter(filter) | ||||
|   } | ||||
|  | ||||
|   static isAgiliteOuDerobee(caracLabel) { | ||||
|     return RdDCarac.isAgilite(caracLabel) | ||||
|       || RdDCarac.isDerobee(caracLabel) | ||||
|   static isAgiliteOuDerobee(selectedCarac) { | ||||
|     return selectedCarac?.label.match(/(Agilité|Dérobée)/); | ||||
|   } | ||||
|  | ||||
|   static isDerobee(caracLabel) { | ||||
|     return Grammar.equalsInsensitive(caracLabel, LIST_CARAC_PERSONNAGE.agilite.code); | ||||
|   static isVolonte(selectedCarac) { | ||||
|     return selectedCarac?.label == 'Volonté'; | ||||
|   } | ||||
|  | ||||
|   static isAgilite(caracLabel) { | ||||
|     return Grammar.equalsInsensitive(caracLabel, LIST_CARAC_DERIVEE.derobee.code); | ||||
|   static isChance(selectedCarac) { | ||||
|     return selectedCarac?.label?.toLowerCase()?.match(/chance( actuelle)?/); | ||||
|   } | ||||
|  | ||||
|   static isIntellect(caracLabel) { | ||||
|     return Grammar.toLowerCaseNoAccent(caracLabel) == 'intellect'; | ||||
|   } | ||||
|  | ||||
|   static isVolonte(caracLabel) { | ||||
|     return Grammar.toLowerCaseNoAccent(caracLabel) == 'volonte'; | ||||
|   } | ||||
|   static isChance(caracLabel) { | ||||
|     return Grammar.toLowerCaseNoAccent(caracLabel)?.match(/chance(( |-)?actuelle)?/); | ||||
|   } | ||||
|   static isReve(caracLabel) { | ||||
|     return Grammar.toLowerCaseNoAccent(caracLabel)?.match(/reve(( |-)?actuel)?/); | ||||
|   static isReve(selectedCarac) { | ||||
|     return selectedCarac?.label?.toLowerCase()?.match(/r(e|ê)ve(( |-)actuel)?/); | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * L’appel à la chance n’est possible que pour recommencer les jets d’actions physiques : | ||||
|    * tous les jets de combat, de FORCE, d’AGILITÉ, de DEXTÉRITÉ, de Dérobée, d’APPARENCE, | ||||
|    * ainsi que de Perception active et volontaire. | ||||
|    * Le moral ne s'utilise aussi que sur les actions physiques | ||||
|    */ | ||||
|   static isActionPhysique(caracLabel) { | ||||
|     return Grammar.toLowerCaseNoAccent(caracLabel) | ||||
|   static isActionPhysique(selectedCarac) { | ||||
|     return Grammar.toLowerCaseNoAccent(selectedCarac?.label) | ||||
|       ?.match(/(apparence|force|agilite|dexterite|vue|ouie|gout|odorat|empathie|melee|tir|lancer|derobee)/) != null | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,9 @@ | ||||
| import { ChatUtility } from "./chat-utility.js"; | ||||
| import { ENTITE_BLURETTE, HIDE_DICE, SYSTEM_RDD, SYSTEM_SOCKET_ID } from "./constants.js"; | ||||
| import { Grammar } from "./grammar.js"; | ||||
| import { RdDItemArme } from "./item-arme.js"; | ||||
| import { RdDItemCompetence } from "./item-competence.js"; | ||||
| import { RdDItemCompetenceCreature } from "./item-competencecreature.js"; | ||||
| import { Misc } from "./misc.js"; | ||||
| import { RdDBonus } from "./rdd-bonus.js"; | ||||
| import { RdDResolutionTable } from "./rdd-resolution-table.js"; | ||||
| @@ -11,30 +14,26 @@ import { STATUSES } from "./settings/status-effects.js"; | ||||
| import { Targets } from "./targets.js"; | ||||
| import { RdDEmpoignade } from "./rdd-empoignade.js"; | ||||
| import { RdDRollResult } from "./rdd-roll-result.js"; | ||||
| import { RdDItemArme } from "./item/arme.js"; | ||||
| import { RdDItemCompetence } from "./item-competence.js"; | ||||
| import { RdDItemCompetenceCreature } from "./item-competencecreature.js"; | ||||
| import { RdDInitiative } from "./initiative.mjs"; | ||||
|  | ||||
| /* -------------------------------------------- */ | ||||
| const premierRoundInit = [ | ||||
|   { pattern: 'hast' }, | ||||
|   { pattern: 'lance' }, | ||||
|   { pattern: 'baton' }, | ||||
|   { pattern: 'doubledragonne' }, | ||||
|   { pattern: 'esparlongue' }, | ||||
|   { pattern: 'epeedragonne' }, | ||||
|   { pattern: 'epeebatarde' }, | ||||
|   { pattern: 'epeecyane' }, | ||||
|   { pattern: 'epeesorde' }, | ||||
|   { pattern: 'grandehache' }, | ||||
|   { pattern: 'bataille' }, | ||||
|   { pattern: 'epeegnome' }, | ||||
|   { pattern: 'masse' }, | ||||
|   { pattern: 'gourdin' }, | ||||
|   { pattern: 'fleau' }, | ||||
|   { pattern: 'dague' }, | ||||
|   { pattern: 'autre' }, | ||||
|   { pattern: 'hast', init: 5.90 }, | ||||
|   { pattern: 'lance', init: 5.85 }, | ||||
|   { pattern: 'baton', init: 5.80 }, | ||||
|   { pattern: 'doubledragonne', init: 5.75 }, | ||||
|   { pattern: 'esparlongue', init: 5.70 }, | ||||
|   { pattern: 'epeedragonne', init: 5.65 }, | ||||
|   { pattern: 'epeebatarde', init: 5.60 }, | ||||
|   { pattern: 'epeecyane', init: 5.55 }, | ||||
|   { pattern: 'epeesorde', init: 5.50 }, | ||||
|   { pattern: 'grandehache', init: 5.45 }, | ||||
|   { pattern: 'bataille', init: 5.40 }, | ||||
|   { pattern: 'epeegnome', init: 5.35 }, | ||||
|   { pattern: 'masse', init: 5.30 }, | ||||
|   { pattern: 'gourdin', init: 5.25 }, | ||||
|   { pattern: 'fleau', init: 5.20 }, | ||||
|   { pattern: 'dague', init: 5.15 }, | ||||
|   { pattern: 'autre', init: 5.10 }, | ||||
| ]; | ||||
|  | ||||
| /* -------------------------------------------- */ | ||||
| @@ -46,10 +45,6 @@ export class RdDCombatManager extends Combat { | ||||
|     Hooks.on("updateCombat", (combat, change, options, userId) => { RdDCombat.onUpdateCombat(combat, change, options, userId) }); | ||||
|     Hooks.on("preDeleteCombat", (combat, html, id) => { combat.onPreDeleteCombat() }) | ||||
|     Hooks.on("deleteCombat", (combat, html, id) => { combat.onDeleteCombat() }) | ||||
|  | ||||
|     for (let i = 0.0; i < premierRoundInit.length; i++) { | ||||
|       premierRoundInit[i].init = 5.99 - i / 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
| @@ -113,7 +108,9 @@ export class RdDCombatManager extends Combat { | ||||
|   async rollInitiative(ids, messageOptions = {}) { | ||||
|     console.log(`${game.system.title} | Combat.rollInitiative()`, ids, messageOptions) | ||||
|     ids = typeof ids === "string" ? [ids] : ids | ||||
|     Promise.all(ids.map(id => this.rollInitRdD(id, undefined, messageOptions))) | ||||
|     ids.forEach(async id => | ||||
|       await this.rollInitRdD(id, undefined, messageOptions) | ||||
|     ) | ||||
|     return this | ||||
|   } | ||||
|  | ||||
| @@ -151,7 +148,7 @@ export class RdDCombatManager extends Combat { | ||||
|   } | ||||
|  | ||||
|   static getFirstInitRollFormula(actor) { | ||||
|     const actions = actor.listActions({ isEquipe: true }) | ||||
|     const actions = actor.listActionsCombat() | ||||
|     if (actions.length > 0) { | ||||
|       const action = actions[0] | ||||
|       const init = RdDCombatManager.getInitData(actor, action) | ||||
| @@ -164,7 +161,87 @@ export class RdDCombatManager extends Combat { | ||||
|   } | ||||
|  | ||||
|   static formuleInitiative(rang, carac, niveau, bonusMalus) { | ||||
|     return `${rang} +( (${RdDInitiative.calculInitiative(niveau, carac, bonusMalus)} )/100)`; | ||||
|     return `${rang} +( (${RdDCombatManager.calculInitiative(niveau, carac, bonusMalus)} )/100)`; | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   static calculInitiative(niveau, caracValue, bonus = 0) { | ||||
|     let base = niveau + Math.floor(caracValue / 2) + bonus; | ||||
|     return "1d6" + (base >= 0 ? "+" : "") + base; | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   /** Retourne une liste triée d'actions d'armes avec le split arme1 main / arme 2 main / lancer */ | ||||
|   static listActionsArmes(armes, competences, carac) { | ||||
|     let actions = []; | ||||
|     for (const arme of armes) { | ||||
|       if (arme.system.equipe) { | ||||
|         const dommages = arme.system.dommages.toString(); | ||||
|         const tableauDommages = dommages.includes("/") ? dommages.split("/") : [dommages, dommages]; | ||||
|         if (arme.system.unemain && arme.system.deuxmains && !dommages.includes("/")) { | ||||
|           ui.notifications.info("Les dommages de l'arme à 1/2 mains " + arme.name + " ne sont pas corrects (ie sous la forme X/Y)"); | ||||
|         } | ||||
|         if (arme.system.unemain && arme.system.competence) { | ||||
|           actions.push(RdDCombatManager.$prepareAttaqueArme({ | ||||
|             arme: arme, | ||||
|             infoMain: "(1 main)", | ||||
|             dommagesReel: Number(tableauDommages[0]), | ||||
|             competence: arme.system.competence, | ||||
|             carac: carac, | ||||
|             competences: competences | ||||
|           })); | ||||
|         } | ||||
|         if (arme.system.deuxmains && arme.system.competence) { | ||||
|           actions.push(RdDCombatManager.$prepareAttaqueArme({ | ||||
|             arme: arme, | ||||
|             infoMain: "(2 mains)", | ||||
|             dommagesReel: Number(tableauDommages[1]), | ||||
|             competence: RdDItemArme.competence2Mains(arme), | ||||
|             carac: carac, | ||||
|             competences: competences | ||||
|           })); | ||||
|         } | ||||
|         if (arme.system.lancer) { | ||||
|           actions.push(RdDCombatManager.$prepareAttaqueArme({ | ||||
|             arme: arme, | ||||
|             infoMain: "(lancer)", | ||||
|             dommagesReel: Number(tableauDommages[0]), | ||||
|             competence: arme.system.lancer, | ||||
|             carac: carac, | ||||
|             competences: competences | ||||
|           })); | ||||
|         } | ||||
|         if (arme.system.tir) { | ||||
|           actions.push(RdDCombatManager.$prepareAttaqueArme({ | ||||
|             arme: arme, | ||||
|             infoMain: "(tir)", | ||||
|             dommagesReel: Number(tableauDommages[0]), | ||||
|             competence: arme.system.tir, | ||||
|             carac: carac, | ||||
|             competences: competences | ||||
|           })); | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|     return actions.sort(Misc.ascending(action => action.name + (action.system.infoMain ?? ''))); | ||||
|   } | ||||
|  | ||||
|   static $prepareAttaqueArme(infoAttaque) { | ||||
|     const comp = infoAttaque.competences.find(it => Grammar.equalsInsensitive(it.name, infoAttaque.competence)) | ||||
|     const arme = infoAttaque.arme; | ||||
|     const attaque = foundry.utils.duplicate(arme) | ||||
|  | ||||
|     const carac = comp?.system.defaut_carac ?? (infoAttaque.infoMain == '(lancer)' ? 'lancer' : infoAttaque.infoMain == '(lancer)' ? 'tir' : 'melee') | ||||
|     const niveau = comp?.system.niveau ?? (infoAttaque.infoMain == '(lancer)' ? -8 : -6) | ||||
|     attaque.action = 'attaque'; | ||||
|     attaque.system.competence = infoAttaque.competence; | ||||
|     attaque.system.dommagesReels = infoAttaque.dommagesReel; | ||||
|     attaque.system.infoMain = infoAttaque.infoMain; | ||||
|     attaque.system.niveau = niveau | ||||
|  | ||||
|     const ajustement = (arme.parent?.getEtatGeneral() ?? 0) + (arme.system.magique) ? arme.system.ecaille_efficacite : 0 | ||||
|     attaque.system.initiative = RdDCombatManager.calculInitiative(niveau, infoAttaque.carac[carac].value, ajustement) | ||||
|     return attaque | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
| @@ -174,20 +251,19 @@ export class RdDCombatManager extends Combat { | ||||
|       let initMissing = game.combat.combatants.find(it => !it.initiative); | ||||
|       if (!initMissing) { // Premier round ! | ||||
|         for (let combatant of game.combat.combatants) { | ||||
|           if (combatant.initiativeData?.arme?.type == "arme") { | ||||
|             // TODO: get init data premier round | ||||
|             const initiativeData = combatant.initiativeData; | ||||
|             const action = combatant.initiativeData.arme; | ||||
|             const fromArme = Grammar.toLowerCaseNoAccentNoSpace(action.system.initpremierround) | ||||
|             const initData = premierRoundInit.find(it => fromArme.includes(initData.pattern)) | ||||
|             if (initData) { | ||||
|               let msg = `<h4>L'initiative de ${combatant.actor.getAlias()} a été modifiée !</h4> | ||||
|           let action = combatant.initiativeData?.arme; | ||||
|           //console.log("Parsed !!!", combatant, initDone, game.combat.current, arme); | ||||
|           if (action && action.type == "arme") { | ||||
|             for (let initData of premierRoundInit) { | ||||
|               if (Grammar.toLowerCaseNoAccentNoSpace(action.system.initpremierround).includes(initData.pattern)) { | ||||
|                 let msg = `<h4>L'initiative de ${combatant.actor.getAlias()} a été modifiée !</h4> | ||||
|                       <hr> | ||||
|                       <div> | ||||
|                         Etant donné son ${action.name}, son initative pour ce premier round est désormais de ${initData.init}. | ||||
|                       </div>` | ||||
|               ChatMessage.create({ content: msg }); | ||||
|               game.combat.setInitiative(combatant._id, initData.init); | ||||
|                 ChatMessage.create({ content: msg }); | ||||
|                 game.combat.setInitiative(combatant._id, initData.init); | ||||
|               } | ||||
|             } | ||||
|           } | ||||
|         } | ||||
| @@ -221,7 +297,7 @@ export class RdDCombatManager extends Combat { | ||||
|     ].concat(options); | ||||
|   } | ||||
|   /* -------------------------------------------- */ | ||||
|   static async rollInitiativeAction(combatantId, action) { | ||||
|   static rollInitiativeAction(combatantId, action) { | ||||
|     const combatant = game.combat.combatants.get(combatantId) | ||||
|     const actor = RdDCombatManager.getActorCombatant(combatant) | ||||
|     if (actor == undefined) { return [] } | ||||
| @@ -229,11 +305,10 @@ export class RdDCombatManager extends Combat { | ||||
|     combatant.initiativeData = { arme: action } // pour reclasser l'init au round 0 | ||||
|  | ||||
|     const init = RdDCombatManager.getInitData(actor, action) | ||||
|     const ajustement = RdDCombatManager.calculAjustementInit(actor, action.arme) | ||||
|     const ajustement = RdDCombatManager.calculAjustementInit(actor, action) | ||||
|     const rollFormula = RdDCombatManager.formuleInitiative(init.offset, init.carac, init.niveau, ajustement); | ||||
|  | ||||
|     await game.combat.rollInitRdD(combatantId, rollFormula, init); | ||||
|     combatant.initiativeData | ||||
|     game.combat.rollInitRdD(combatantId, rollFormula, init); | ||||
|   } | ||||
|  | ||||
|   static getInitData(actor, action) { | ||||
| @@ -243,12 +318,12 @@ export class RdDCombatManager extends Combat { | ||||
|     if (action.action == 'possession') { return { offset: 10, info: "Possession", carac: actor.getReveActuel(), niveau: 0 } } | ||||
|     if (action.action == 'haut-reve') { return { offset: 9, info: "Draconic", carac: actor.getReveActuel(), niveau: 0 } } | ||||
|  | ||||
|     const comp = action.comp | ||||
|     const comp = RdDItemCompetence.findCompetence(actor.items, action.system.competence); | ||||
|     return { | ||||
|       offset: RdDCombatManager.initOffset(comp?.system.categorie, action.arme), | ||||
|       info: action.name + " / " + comp.name, | ||||
|       offset: RdDCombatManager.initOffset(comp?.system.categorie, action), | ||||
|       info: action.name + " / " + action.system.competence, | ||||
|       carac: actor.getCaracInit(comp), | ||||
|       niveau: comp?.system.niveau ?? (['(lancer)', '(tir)'].includes(action.main) ? -8 : -6) | ||||
|       niveau: comp?.system.niveau ?? -8 | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -291,7 +366,7 @@ export class RdDCombatManager extends Combat { | ||||
|     const possessions = actor.listActionsPossessions() | ||||
|     const actions = possessions.length > 0 | ||||
|       ? possessions | ||||
|       : actor.listActions({ isEquipe: true }) | ||||
|       : actor.listActionsCombat() | ||||
|  | ||||
|     for (let index = 0; index < actions.length; index++) { | ||||
|       actions[index].index = index | ||||
| @@ -408,7 +483,7 @@ export class RdDCombat { | ||||
|       '.appel-destinee-attaque', | ||||
|       '.echec-total-attaque', | ||||
|     ]) { | ||||
|       $(html).on("click", button, event => { | ||||
|       html.on("click", button, event => { | ||||
|         const rddCombat = RdDCombat.rddCombatForAttackerAndDefender( | ||||
|           event.currentTarget.attributes['data-attackerId']?.value, | ||||
|           event.currentTarget.attributes['data-attackerTokenId']?.value, | ||||
| @@ -419,7 +494,7 @@ export class RdDCombat { | ||||
|         } | ||||
|       }); | ||||
|     } | ||||
|     $(html).on("click", 'a.chat-jet-vie', event => { | ||||
|     html.on("click", 'a.chat-jet-vie', event => { | ||||
|       event.preventDefault(); | ||||
|       RdDCombat._callJetDeVie(event); | ||||
|     }); | ||||
| @@ -635,9 +710,8 @@ export class RdDCombat { | ||||
|     if (taille <= 20) return { msg: "ogre", diff: 2 }; | ||||
|     return { msg: "gigantesque", diff: 4 }; | ||||
|   } | ||||
|  | ||||
|   _ajustementMouvement(defender) { | ||||
|     if (defender.getSurprise(true) != '') return { msg: "immobile (surprise)", diff: 0 }; | ||||
|     if (defender.getSurprise(true)) return { msg: "immobile (surprise)", diff: 0 }; | ||||
|     if (game.combat?.combatants.find(it => it.actorId == defender.id)) return { msg: "en mouvement (combat)", diff: -4 }; | ||||
|     return { msg: "à déterminer (0 immobile, -3 actif, -4 en mouvement, -5 en zig-zag)", diff: -3 }; | ||||
|   } | ||||
| @@ -701,7 +775,7 @@ export class RdDCombat { | ||||
|       // sans armes: à mains nues | ||||
|       rollData.arme = RdDItemArme.corpsACorps(this.attacker) | ||||
|       rollData.arme.system.niveau = competence.system.niveau | ||||
|       rollData.arme.system.initiative = RdDInitiative.calculInitiative(competence.system.niveau, this.attacker.system.carac['melee'].value); | ||||
|       rollData.arme.system.initiative = RdDCombatManager.calculInitiative(competence.system.niveau, this.attacker.system.carac['melee'].value); | ||||
|     } | ||||
|     return rollData; | ||||
|   } | ||||
| @@ -860,7 +934,7 @@ export class RdDCombat { | ||||
|     let defenses = defender.items.filter(it => RdDItemArme.isParade(it)) | ||||
|     defenses = foundry.utils.duplicate(defenses) | ||||
|     defenses.forEach(armeDefense => { | ||||
|       // Ajout du # d'utilisation ce round | ||||
|       // Ajout du # d'utilisation ce round   | ||||
|       armeDefense.nbUsage = defender.getItemUse(armeDefense.id) | ||||
|       armeDefense.typeParade = RdDItemArme.defenseArmeParade(armeAttaque, armeDefense) | ||||
|     }) | ||||
| @@ -973,12 +1047,11 @@ export class RdDCombat { | ||||
|  | ||||
|  | ||||
|   async _onParade(defenderRoll) { | ||||
|     if (RdDCombat.isParticuliere(defenderRoll)) { | ||||
|       return await this._onParadeParticuliere(defenderRoll) | ||||
|     } | ||||
|     if (RdDCombat.isReussite(defenderRoll)) { | ||||
|       await this._onParadeNormale(defenderRoll) | ||||
|       if (RdDCombat.isParticuliere(defenderRoll)) { | ||||
|         await this._onParadeParticuliere(defenderRoll) | ||||
|       } | ||||
|       return | ||||
|       return await this._onParadeNormale(defenderRoll) | ||||
|     } | ||||
|     await this._onParadeEchec(defenderRoll) | ||||
|   } | ||||
| @@ -1062,12 +1135,11 @@ export class RdDCombat { | ||||
|   } | ||||
|  | ||||
|   async _onEsquive(defenderRoll) { | ||||
|     if (RdDCombat.isParticuliere(defenderRoll)) { | ||||
|       return await this._onEsquiveParticuliere(defenderRoll) | ||||
|     } | ||||
|     if (RdDCombat.isReussite(defenderRoll)) { | ||||
|       await this._onEsquiveNormale(defenderRoll) | ||||
|       if (RdDCombat.isParticuliere(defenderRoll)) { | ||||
|         await this._onEsquiveParticuliere(defenderRoll) | ||||
|       } | ||||
|       return | ||||
|       return await this._onEsquiveNormale(defenderRoll) | ||||
|     } | ||||
|     return await this._onEsquiveEchec(defenderRoll) | ||||
|   } | ||||
|   | ||||
| @@ -9,7 +9,7 @@ export class RdDCompendiumOrganiser { | ||||
|     console.log('onRenderCompendium', compendium, html, compendiumData); | ||||
|     const pack = compendium.collection | ||||
|     if (pack.metadata.system === SYSTEM_RDD) { | ||||
|       $(html).find('.directory-item').each((i, element) => { | ||||
|       html.find('.directory-item').each((i, element) => { | ||||
|         RdDCompendiumOrganiser.setEntityTypeName(pack, element); | ||||
|       }); | ||||
|     } | ||||
| @@ -26,7 +26,7 @@ export class RdDCompendiumOrganiser { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|  | ||||
|    | ||||
|   static getEntityTypeLabel(entity) { | ||||
|     const documentName = entity?.documentName | ||||
|     const type = entity?.type | ||||
|   | ||||
| @@ -12,7 +12,7 @@ const imgHeures = [1, 2, 3, 4, 5, 6, 7, 9, 9, 10, 11, 12].map(heure => { | ||||
| const imgSigneDragon = imgHeures[4] | ||||
|  | ||||
| /** De pour les jets de rencontre */ | ||||
| export class DeTMR extends foundry.dice.terms.Die { | ||||
| export class DeTMR extends Die { | ||||
|   /** @override */ | ||||
|   static DENOMINATION = "t"; | ||||
|  | ||||
| @@ -50,7 +50,7 @@ export class DeTMR extends foundry.dice.terms.Die { | ||||
| } | ||||
|  | ||||
| /** DeDraconique pour le D8 sans limite avec 8=>0 */ | ||||
| export class DeDraconique extends foundry.dice.terms.Die { | ||||
| export class DeDraconique extends Die { | ||||
|   /** @override */ | ||||
|   static DENOMINATION = "r"; | ||||
|  | ||||
| @@ -89,7 +89,7 @@ export class DeDraconique extends foundry.dice.terms.Die { | ||||
| } | ||||
|  | ||||
| /** De 12 avec les heures */ | ||||
| export class DeHeure extends foundry.dice.terms.Die { | ||||
| export class DeHeure extends Die { | ||||
|  | ||||
|   /** @override */ | ||||
|   static DENOMINATION = "h"; | ||||
|   | ||||
| @@ -15,36 +15,36 @@ export class RdDEmpoignade { | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   static registerChatCallbacks(html) { | ||||
|     $(html).on("click", '.defense-empoignade-cac', event => { | ||||
|     html.on("click", '.defense-empoignade-cac', event => { | ||||
|       const chatMessage = ChatUtility.getChatMessage(event); | ||||
|       const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage); | ||||
|       let defenseMode = event.currentTarget.attributes['data-defense-mode'].value | ||||
|       RdDEmpoignade.onDefenseEmpoignade(rollData, defenseMode, "Corps à corps", "melee") | ||||
|     }); | ||||
|     $(html).on("click", '.defense-empoignade-esquive', event => { | ||||
|     html.on("click", '.defense-empoignade-esquive', event => { | ||||
|       const chatMessage = ChatUtility.getChatMessage(event); | ||||
|       const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage); | ||||
|       let defenseMode = event.currentTarget.attributes['data-defense-mode'].value | ||||
|       RdDEmpoignade.onDefenseEmpoignade(rollData, defenseMode, "Esquive", "derobee") | ||||
|     }); | ||||
|     $(html).on("click", '.empoignade-poursuivre', event => { | ||||
|     html.on("click", '.empoignade-poursuivre', event => { | ||||
|       let attackerId = event.currentTarget.attributes['data-attackerId'].value | ||||
|       let defenderId = event.currentTarget.attributes['data-defenderId'].value | ||||
|       RdDEmpoignade.onAttaqueEmpoignadeValidee(game.actors.get(attackerId), game.actors.get(defenderId)) | ||||
|     }); | ||||
|     $(html).on("click", '.empoignade-entrainer-sol', event => { | ||||
|     html.on("click", '.empoignade-entrainer-sol', event => { | ||||
|       const chatMessage = ChatUtility.getChatMessage(event); | ||||
|       const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage); | ||||
|       RdDEmpoignade.entrainerAuSol(rollData) | ||||
|       ChatUtility.removeChatMessageId(chatMessage.id) | ||||
|     }); | ||||
|     $(html).on("click", '.empoignade-projeter-sol', event => { | ||||
|     html.on("click", '.empoignade-projeter-sol', event => { | ||||
|       const chatMessage = ChatUtility.getChatMessage(event); | ||||
|       const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage); | ||||
|       RdDEmpoignade.projeterAuSol(rollData) | ||||
|       ChatUtility.removeChatMessageId(chatMessage.id) | ||||
|     }); | ||||
|     $(html).on("change", '.empoignade-perte-endurance', event => { | ||||
|     html.on("change", '.empoignade-perte-endurance', event => { | ||||
|       const chatMessage = ChatUtility.getChatMessage(event); | ||||
|       const rollData = RdDEmpoignade.$readRollEmpoignade(chatMessage); | ||||
|       if (event.currentTarget.value && event.currentTarget.value != "none") { | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { RdDItemArme } from "./item/arme.js"; | ||||
| import { RdDItemArme } from "./item-arme.js"; | ||||
| import { RdDItemCompetenceCreature } from "./item-competencecreature.js"; | ||||
| import { ITEM_TYPES } from "./constants.js"; | ||||
|  | ||||
| @@ -22,12 +22,13 @@ export class RdDHotbar { | ||||
|  | ||||
|   static $macroNameSuffix(armeCompetence) { | ||||
|     switch (armeCompetence) { | ||||
|       case '(1 main)': return ' (1 main)'; | ||||
|       case '(2 mains)': return ' (2 main)'; | ||||
|       case 'unemain': return ' (1 main)'; | ||||
|       case 'deuxmains': return ' (2 main)'; | ||||
|       case 'tir': return ' (tir)'; | ||||
|       case 'lancer': return ' (lancer)'; | ||||
|       case 'pugilat': return ' (pugilat)'; | ||||
|       case 'empoignade': return ' (empoignade)'; | ||||
|  | ||||
|     } | ||||
|     return '' | ||||
|   } | ||||
| @@ -39,10 +40,10 @@ export class RdDHotbar { | ||||
|           // Les armes peuvent avoir plusieurs usages | ||||
|           if (item.system.competence != '') { | ||||
|             if (item.system.unemain) { | ||||
|               await this.createItemMacro(item, slot++, '(1 main)') | ||||
|               await this.createItemMacro(item, slot++, 'unemain') | ||||
|             } | ||||
|             if (item.system.deuxmains) { | ||||
|               await this.createItemMacro(item, slot++, '(2 mains)') | ||||
|               await this.createItemMacro(item, slot++, 'deuxmains') | ||||
|             } | ||||
|           } | ||||
|           if (item.system.lancer != '') { | ||||
| @@ -120,9 +121,9 @@ export class RdDHotbar { | ||||
|         if (item.isCorpsACorps()) { | ||||
|           switch (categorieArme) { | ||||
|             case 'pugilat': | ||||
|               return actor.rollArme(RdDItemArme.corpsACorps(actor)); | ||||
|               return actor.rollArme(RdDItemArme.corpsACorps(actor), 'competence'); | ||||
|             case 'empoignade': | ||||
|               return actor.rollArme(RdDItemArme.empoignade(actor)); | ||||
|               return actor.rollArme(RdDItemArme.empoignade(actor), 'competence'); | ||||
|           } | ||||
|         } | ||||
|         return actor.rollCompetence(item); | ||||
|   | ||||