Compare commits
40 Commits
13.0.36
...
feature/v1
| Author | SHA1 | Date | |
|---|---|---|---|
| e34449631c | |||
| f8a20b90ff | |||
| 749eb5ee13 | |||
| 17cb8a2e06 | |||
| 933256da66 | |||
| a58b171fb4 | |||
| 2eac969261 | |||
|
|
e6612fe024 | ||
|
|
18b9e4c7a8 | ||
| fcaebe6334 | |||
| c4033707be | |||
| 8b83369d5a | |||
| e9183df59c | |||
| 45ccac3489 | |||
| c41db974ff | |||
| 875e121a09 | |||
| 12e0e6397c | |||
| 93b74574ad | |||
| 1765cb2ef9 | |||
| 0cbd7a6deb | |||
| aec4364889 | |||
| f17996b1c8 | |||
| 14a4b34bbd | |||
| 1777eced30 | |||
| 9bdda32d54 | |||
| 3fe53d7ff0 | |||
| c839d4633d | |||
| 24753bfc29 | |||
| e7acb0c4f2 | |||
| 7535e5f340 | |||
| d2326e5a25 | |||
| e2afc24601 | |||
| f220e3a394 | |||
| 1d9348b701 | |||
| d96dff988e | |||
| 9966a33524 | |||
| 7fb0ee1659 | |||
| d15d0989a3 | |||
| 704c99e418 | |||
| 9ccc068333 |
@@ -32,7 +32,7 @@ jobs:
|
||||
env:
|
||||
version: ${{steps.get_version.outputs.version-without-v}}
|
||||
url: https://gitea.scriptarium.org/${{gitea.repository}}
|
||||
manifest: https://gitea.scriptarium.org/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/system.json
|
||||
manifest: "https://gitea.scriptarium.org/Scriptarium/foundryvtt-reve-de-dragon/releases/download/latest/system.json"
|
||||
download: https://gitea.scriptarium.org/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/rddsystem.zip
|
||||
|
||||
- name: Set up Node.js
|
||||
@@ -64,12 +64,12 @@ jobs:
|
||||
api_key: "${{secrets.RDD_PUBLISH_RELEASE}}"
|
||||
|
||||
- name: Publish to Foundry server
|
||||
uses: djlechuck/foundryvtt-publish-package-action@v1
|
||||
uses: djlechuck/foundryvtt-publish-package-action@v1.1.0
|
||||
with:
|
||||
token: ${{ secrets.RDD_PUBLISH_RELEASE_FOUNDRY }}
|
||||
id: "foundryvtt-reve-de-dragon"
|
||||
version: ${{github.event.release.tag_name}}
|
||||
manifest: "https://gitea.scriptarium.org/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/system.json"
|
||||
manifest: https://gitea.scriptarium.org/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/system.json
|
||||
notes: "https://gitea.scriptarium.org/Scriptarium/foundryvtt-reve-de-dragon/raw/branch/v13/changelog.md"
|
||||
compatibility-minimum: "13"
|
||||
compatibility-verified: "13"
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,3 +12,4 @@ todo.md
|
||||
/packs/*/CURRENT
|
||||
/packs/*/LOG
|
||||
/packs/*/LOCK
|
||||
.github/
|
||||
|
||||
@@ -1 +1,87 @@
|
||||
<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>
|
||||
<?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 649.20972 359.75745"
|
||||
version="1.1"
|
||||
id="svg6"
|
||||
sodipodi:docname="_d100.svg"
|
||||
width="649.20972"
|
||||
height="359.75745"
|
||||
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="2202"
|
||||
inkscape:window-height="1379"
|
||||
id="namedview8"
|
||||
showgrid="true"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:zoom="1.4355469"
|
||||
inkscape:cx="366.48667"
|
||||
inkscape:cy="102.06012"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg6">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid837"
|
||||
originx="110.48667"
|
||||
originy="-153.93988" />
|
||||
</sodipodi:namedview>
|
||||
<g
|
||||
class=""
|
||||
id="g4"
|
||||
style="fill:#ffffff"
|
||||
transform="translate(-94.621782,-91.536548)">
|
||||
<path
|
||||
d="m 375.483,251.243 -109.98,51.138 0.213,183.381 211.294,-219.416 -86.993,-21.81 z m -12.736,108.626 -5.947,14.699 -48.604,-8.955 5.007,-12.832 a 141.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.97 l 14.068,2.51 q -9.37,22.334 -30.361,44.43 -13.296,13.64 -20.645,18.636 z M 121.603,244.334 36.893,266.097 246.474,486 V 302.38 L 136.528,251.243 Z m 19.147,50.852 a 28.72,28.72 0 0 1 24.273,6.802 53.052,53.052 0 0 1 11.226,14.188 l -13.081,2.676 a 28.542,28.542 0 0 0 -5.388,-7.374 q -5.185,-4.876 -11.262,-3.853 l -0.487,0.095 a 6.458,6.458 0 0 0 -5.162,4.448 c -0.856,2.378 -0.238,5.554 1.796,9.371 q 4.08,7.6 10.81,9.027 a 23.785,23.785 0 0 0 8.563,-0.203 l 1.867,-0.344 5.791,10.822 q -6.398,1.427 -8.23,3.282 -3.21,3.14 0.429,9.93 a 17.042,17.042 0 0 0 6.089,6.696 10.406,10.406 0 0 0 7.385,1.534 l 0.416,-0.083 q 4.757,-0.964 5.079,-4.757 c 0.261,-2.57 -0.655,-5.744 -2.748,-9.514 l 12.38,-2.545 a 49.247,49.247 0 0 1 4.103,11.226 19.956,19.956 0 0 1 -0.642,9.383 11.702,11.702 0 0 1 -3.96,5.411 19.575,19.575 0 0 1 -8.027,3.235 l -1.19,0.214 a 27.971,27.971 0 0 1 -17.494,-2.7 32.193,32.193 0 0 1 -14.128,-14.092 q -3.627,-6.79 -2.604,-12.19 a 8.396,8.396 0 0 1 2.521,-4.947 h -0.071 q -1.844,0.31 -7.04,-2.497 a 32.11,32.11 0 0 1 -12.916,-13.593 q -5.245,-9.764 -3.282,-18.398 1.962,-8.634 13.676,-11 z M 27.19,248.865 135.97,132.556 a 7.135,7.135 0 0 1 1.427,0 h 0.154 q 3.14,0.345 2.842,3.71 a 19.36,19.36 0 0 1 -3.294,8.1 39.376,39.376 0 0 1 -9.728,10.405 q -3.912,2.938 -15.044,9.514 -12.796,7.505 -19.55,14.77 a 92.535,92.535 0 0 0 -11.513,14.486 l 32.907,3.758 8.182,-12.963 -20.967,-2.378 a 36.415,36.415 0 0 1 4.757,-3.83 q 2.379,-1.605 8.444,-5.125 l 6.422,-3.747 a 92.975,92.975 0 0 0 12.903,-8.776 61.472,61.472 0 0 0 12.51,-14.414 q 6.84,-10.846 6.494,-17.957 c -0.19,-3.949 -2.105,-6.434 -5.684,-7.505 l 79.798,-85.161 -102.097,179.576 -5.708,10.06 z m 367.238,-71.974 q -3.817,-5.458 -3.758,-8.515 c 0,-2.033 1.19,-3.199 3.568,-3.448 h 0.57 a 11.892,11.892 0 0 1 6.91,2.247 29.85,29.85 0 0 1 7.837,8.051 q 3.687,5.28 3.71,8.397 c 0,2.093 -1.188,3.258 -3.496,3.567 h -0.594 a 11.75,11.75 0 0 1 -6.957,-2.378 29.79,29.79 0 0 1 -7.79,-7.885 z m -109.41,-141.52 83.948,89.634 h -1.189 c -0.38,0 -0.975,0 -1.463,0.107 q -7.825,0.892 -8.324,6.862 -0.5,5.97 5.03,13.747 a 53.778,53.778 0 0 0 6.375,7.374 37.901,37.901 0 0 0 10.144,6.897 q -2.117,2.89 -0.702,7.98 a 37.283,37.283 0 0 0 5.613,11.096 55.122,55.122 0 0 0 15.223,14.806 q 8.098,5.268 16.066,4.935 0.81,0 1.618,-0.13 8.776,-0.988 9.228,-7.873 a 16.114,16.114 0 0 0 -0.463,-4.853 l 58.689,62.686 -91.572,-22.941 -6.1,-10.703 z m 98.22,104.927 2.45,2.617 c 0.451,0.57 0.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.02 h -0.512 a 10.346,10.346 0 0 1 -6.077,-1.95 22.596,22.596 0 0 1 -6.184,-6.137 c -1.974,-2.83 -2.937,-5.102 -2.878,-6.814 0.06,-1.713 1.118,-2.7 3.187,-2.937 h 0.524 a 10.263,10.263 0 0 1 6.005,1.879 19.147,19.147 0 0 1 2.533,2.01 z M 255.987,26 137.456,231.026 l 118.532,55.05 118.604,-55.05 z m -1.19,208.463 q -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.285 z m 10.538,-71.807 q 2.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.547 2.593,-7.968 10.632,-7.968 8.015,-0.012 10.513,7.956 z"
|
||||
fill="#ffffff"
|
||||
fill-opacity="1"
|
||||
transform="matrix(0.69282032,-0.4,0.4,0.69282032,-23.762003,181.038)"
|
||||
id="path2"
|
||||
style="fill:#ffffff" />
|
||||
</g>
|
||||
<g
|
||||
class=""
|
||||
id="g4-4"
|
||||
style="fill:#ffffff"
|
||||
transform="rotate(12.267903,709.7839,1245.6727)">
|
||||
<path
|
||||
d="m 375.483,251.243 -109.98,51.138 0.213,183.381 211.294,-219.416 -86.993,-21.81 z m -12.736,108.626 -5.947,14.699 -48.604,-8.955 5.007,-12.832 a 141.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.97 l 14.068,2.51 q -9.37,22.334 -30.361,44.43 -13.296,13.64 -20.645,18.636 z M 121.603,244.334 36.893,266.097 246.474,486 V 302.38 L 136.528,251.243 Z m 19.147,50.852 a 28.72,28.72 0 0 1 24.273,6.802 53.052,53.052 0 0 1 11.226,14.188 l -13.081,2.676 a 28.542,28.542 0 0 0 -5.388,-7.374 q -5.185,-4.876 -11.262,-3.853 l -0.487,0.095 a 6.458,6.458 0 0 0 -5.162,4.448 c -0.856,2.378 -0.238,5.554 1.796,9.371 q 4.08,7.6 10.81,9.027 a 23.785,23.785 0 0 0 8.563,-0.203 l 1.867,-0.344 5.791,10.822 q -6.398,1.427 -8.23,3.282 -3.21,3.14 0.429,9.93 a 17.042,17.042 0 0 0 6.089,6.696 10.406,10.406 0 0 0 7.385,1.534 l 0.416,-0.083 q 4.757,-0.964 5.079,-4.757 c 0.261,-2.57 -0.655,-5.744 -2.748,-9.514 l 12.38,-2.545 a 49.247,49.247 0 0 1 4.103,11.226 19.956,19.956 0 0 1 -0.642,9.383 11.702,11.702 0 0 1 -3.96,5.411 19.575,19.575 0 0 1 -8.027,3.235 l -1.19,0.214 a 27.971,27.971 0 0 1 -17.494,-2.7 32.193,32.193 0 0 1 -14.128,-14.092 q -3.627,-6.79 -2.604,-12.19 a 8.396,8.396 0 0 1 2.521,-4.947 h -0.071 q -1.844,0.31 -7.04,-2.497 a 32.11,32.11 0 0 1 -12.916,-13.593 q -5.245,-9.764 -3.282,-18.398 1.962,-8.634 13.676,-11 z M 27.19,248.865 135.97,132.556 a 7.135,7.135 0 0 1 1.427,0 h 0.154 q 3.14,0.345 2.842,3.71 a 19.36,19.36 0 0 1 -3.294,8.1 39.376,39.376 0 0 1 -9.728,10.405 q -3.912,2.938 -15.044,9.514 -12.796,7.505 -19.55,14.77 a 92.535,92.535 0 0 0 -11.513,14.486 l 32.907,3.758 8.182,-12.963 -20.967,-2.378 a 36.415,36.415 0 0 1 4.757,-3.83 q 2.379,-1.605 8.444,-5.125 l 6.422,-3.747 a 92.975,92.975 0 0 0 12.903,-8.776 61.472,61.472 0 0 0 12.51,-14.414 q 6.84,-10.846 6.494,-17.957 c -0.19,-3.949 -2.105,-6.434 -5.684,-7.505 l 79.798,-85.161 -102.097,179.576 -5.708,10.06 z m 367.238,-71.974 q -3.817,-5.458 -3.758,-8.515 c 0,-2.033 1.19,-3.199 3.568,-3.448 h 0.57 a 11.892,11.892 0 0 1 6.91,2.247 29.85,29.85 0 0 1 7.837,8.051 q 3.687,5.28 3.71,8.397 c 0,2.093 -1.188,3.258 -3.496,3.567 h -0.594 a 11.75,11.75 0 0 1 -6.957,-2.378 29.79,29.79 0 0 1 -7.79,-7.885 z m -109.41,-141.52 83.948,89.634 h -1.189 c -0.38,0 -0.975,0 -1.463,0.107 q -7.825,0.892 -8.324,6.862 -0.5,5.97 5.03,13.747 a 53.778,53.778 0 0 0 6.375,7.374 37.901,37.901 0 0 0 10.144,6.897 q -2.117,2.89 -0.702,7.98 a 37.283,37.283 0 0 0 5.613,11.096 55.122,55.122 0 0 0 15.223,14.806 q 8.098,5.268 16.066,4.935 0.81,0 1.618,-0.13 8.776,-0.988 9.228,-7.873 a 16.114,16.114 0 0 0 -0.463,-4.853 l 58.689,62.686 -91.572,-22.941 -6.1,-10.703 z m 98.22,104.927 2.45,2.617 c 0.451,0.57 0.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.02 h -0.512 a 10.346,10.346 0 0 1 -6.077,-1.95 22.596,22.596 0 0 1 -6.184,-6.137 c -1.974,-2.83 -2.937,-5.102 -2.878,-6.814 0.06,-1.713 1.118,-2.7 3.187,-2.937 h 0.524 a 10.263,10.263 0 0 1 6.005,1.879 19.147,19.147 0 0 1 2.533,2.01 z M 255.987,26 137.456,231.026 l 118.532,55.05 118.604,-55.05 z m -1.19,208.463 q -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.285 z m 10.538,-71.807 q 2.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.547 2.593,-7.968 10.632,-7.968 8.015,-0.012 10.513,7.956 z"
|
||||
fill="#ffffff"
|
||||
fill-opacity="1"
|
||||
transform="matrix(0.69282032,-0.4,0.4,0.69282032,-23.762003,181.038)"
|
||||
id="path2-6"
|
||||
style="fill:#ffffff" />
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 9.3 KiB |
69
changelog.md
69
changelog.md
@@ -1,5 +1,74 @@
|
||||
# 13.0
|
||||
|
||||
## 13.0.46 - L'archétype d'Illisys
|
||||
|
||||
- ajout d'une génération d'archétype aléatoire
|
||||
- respecte les niveaux d'archétype déjà alloués
|
||||
- l'archétype alloué est supérieur au niveau actuel (si c'est possible)
|
||||
- les compétences supérieures à 0 ont plus de chances d'avoir les niveaux d'archétype élevés
|
||||
- si tous les niveaux d'archétype supérieurs à une compétences sont déjà alloué,
|
||||
l'archétype est au niveau actuel de la compétence
|
||||
- Amélioration de l'affichage de la fenêtre de jets:
|
||||
- La difficultée est déplacée dans la colonne des ajustements
|
||||
- les ajustements sont mieux alignés
|
||||
- les ajustements sont mieux ordonnés
|
||||
- Les indications d'ajustements de tir prennent moins de place
|
||||
- l'icône d100 est redessinée pour être mieux centrée
|
||||
|
||||
## 13.0.45 - L'endépôté d'Illisys
|
||||
|
||||
- nouvelle correction du manifest
|
||||
|
||||
## 13.0.44 - Le dépôt d'Illisys
|
||||
|
||||
- le manifest pointe maintenant toujours vers la dernière version
|
||||
- changement des liens dans le system.json
|
||||
|
||||
## 13.0.43 - L'urgence d'Illisys
|
||||
|
||||
- correction urgente des jets
|
||||
|
||||
## 13.0.42 - La rebellion d'Illisys
|
||||
|
||||
- on peut choisir la difficulté des jets de résistances
|
||||
- la macro signe draconique fonctionne de nouveau (ajout et suppression)
|
||||
- le Guerrier Sorde n'est pas joueur et ne cuisine pas (pas de message si compétence Jeu / Cuisine manquent)
|
||||
- Corrections V14
|
||||
- Les descriptions aléatoires fonctionnent de nouveau
|
||||
|
||||
## 13.0.41 - Le miroir d'Illisys
|
||||
|
||||
- les mode de visibilité des jets sont bien pris en compte
|
||||
|
||||
## 13.0.40 - Le miroir d'Illisys
|
||||
|
||||
- pas de stress ou de sommeil pour les personnage non liés
|
||||
|
||||
## 13.0.39 - La défense d'Illisys
|
||||
|
||||
- mise à jour de version foundry-cli
|
||||
- correction des catégories de parades des compendiums
|
||||
- des ne pouvaient pas parer (exemple: le bouclier du guerrier sorde)
|
||||
- les difficultés des jets d'attaque/défense après appel à la chance sont conservées
|
||||
- L'absence des compétences cuisine/jeu ne bloque plus l'accès à la fenêtre de jets (cas des invocations)
|
||||
|
||||
## 13.0.38 - L'urgence d'Illisys
|
||||
|
||||
- Corrections v14
|
||||
- on peut utiliser les commandes foundry dans le tchat (par exemple, /roll 1d6)
|
||||
- les dés customisés Dice-So-Nice (heure, rencontres, dé draconique) fonctionnent
|
||||
- Le Haut-rêve est de nouveau proposé dans les options d'initiative
|
||||
- Nouvelle règle optionnelle: choisir si seules les armes équipées sont proposées en combat
|
||||
- L'appel à la chance utilise la nouvelle fenêtre de jet de dés
|
||||
|
||||
## 13.0.37 - Le bonheur des zyglutes d'Illisys
|
||||
|
||||
- Corrections v14
|
||||
- correction du problème liè à Foundry 14 qui peut empêcher d'utiliser les fenêtres de jets à cause de migrations mal effectuées
|
||||
- Les bon moments sont affichés en tooltip sur le moral
|
||||
- Les modifications de coeurs fonctionnent de nouveau
|
||||
- Le refoulement est remis à zéro après avoir refoulé et reçu un souffle
|
||||
|
||||
## 13.0.36 - Les rêveries d'Illisys
|
||||
|
||||
- Corrections v14
|
||||
|
||||
@@ -514,6 +514,13 @@ body {
|
||||
align-items: anchor-center;
|
||||
margin: 0 0.2rem;
|
||||
}
|
||||
.system-foundryvtt-reve-de-dragon .roll-dialog roll-section label,
|
||||
.system-foundryvtt-reve-de-dragon .roll-dialog roll-section div label {
|
||||
text-align: left;
|
||||
min-width: 55%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.system-foundryvtt-reve-de-dragon .roll-dialog roll-resume {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@@ -670,10 +677,14 @@ body {
|
||||
padding: 0;
|
||||
filter: invert(0.8);
|
||||
}
|
||||
.system-foundryvtt-reve-de-dragon .roll-dialog roll-conditions roll-section[name="tricher"] img {
|
||||
.system-foundryvtt-reve-de-dragon .roll-dialog roll-conditions roll-section[name="tricher"] label {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.system-foundryvtt-reve-de-dragon .roll-dialog roll-conditions roll-section[name="tricher"] label img {
|
||||
/* image de d100 */
|
||||
max-width: 2.5rem;
|
||||
max-height: 2.5rem;
|
||||
max-width: 2rem;
|
||||
max-height: 2rem;
|
||||
}
|
||||
.system-foundryvtt-reve-de-dragon .roll-dialog roll-buttons {
|
||||
display: flex;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
roll-conditions roll-section[name="rollmode"],
|
||||
roll-type {
|
||||
button[data-checked="true"] {
|
||||
@@ -64,6 +65,13 @@
|
||||
flex-direction: row;
|
||||
align-items: anchor-center;
|
||||
margin: 0 0.2rem;
|
||||
|
||||
label {
|
||||
text-align:left;
|
||||
min-width: 55%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
}
|
||||
|
||||
roll-resume {
|
||||
@@ -241,11 +249,18 @@
|
||||
padding: 0;
|
||||
filter: invert(0.8);
|
||||
}
|
||||
roll-conditions roll-section[name="tricher"] img {
|
||||
/* image de d100 */
|
||||
max-width: 2.5rem;
|
||||
max-height: 2.5rem;
|
||||
}
|
||||
roll-conditions roll-section[name="tricher"] {
|
||||
label {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
img {
|
||||
/* image de d100 */
|
||||
max-width: 2rem;
|
||||
max-height: 2rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
roll-buttons {
|
||||
display: flex;
|
||||
|
||||
@@ -216,7 +216,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
|
||||
// Points de reve actuel
|
||||
this.html.find('.roll-reve-actuel').click(async event => await this.actor.rollReveActuel({ resistance: false }))
|
||||
this.html.find('.button-reve-resistance').click(async event => await this.actor.rollReveActuel({ diff: -8, resistance: true }))
|
||||
this.html.find('.button-reve-resistance').click(async event => await this.actor.rollReveResistance())
|
||||
this.html.find('.action-empoignade').click(async event => await RdDEmpoignade.onAttaqueEmpoignadeFromItem(RdDSheetUtility.getItem(event, this.actor)))
|
||||
|
||||
this.html.find('.roll-arme').click(async event => {
|
||||
@@ -275,6 +275,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
await this.actor.updateCompetenceArchetype(compName, parseInt(event.target.value));
|
||||
});
|
||||
this.html.find('.nouvelle-incarnation').click(async event => await this.actor.nouvelleIncarnation())
|
||||
this.html.find('.repartition-archetype-aleatoire').click(async event => await this.actor.repartitionArchetypeAleatoire())
|
||||
}
|
||||
|
||||
// On pts de reve change
|
||||
|
||||
352
module/actor.js
352
module/actor.js
@@ -47,11 +47,7 @@ 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";
|
||||
import { ROLL_TYPE_JEU, ROLL_TYPE_MEDITATION, ROLL_TYPE_SORT } from "./roll/roll-constants.mjs";
|
||||
import { PART_TACHE } from "./roll/roll-part-tache.mjs";
|
||||
import { PART_COMP } from "./roll/roll-part-comp.mjs";
|
||||
import { PART_OEUVRE } from "./roll/roll-part-oeuvre.mjs";
|
||||
import { PART_CUISINE } from "./roll/roll-part-cuisine.mjs";
|
||||
import { ROLL_TYPE_COMP, ROLL_TYPE_CUISINE, ROLL_TYPE_JEU, ROLL_TYPE_MEDITATION, ROLL_TYPE_OEUVRE, ROLL_TYPE_SORT, ROLL_TYPE_APPEL_CHANCE, ROLL_TYPE_TACHE } from "./roll/roll-constants.mjs";
|
||||
import { RdDPossessionV2 } from "./rdd-possession-v2.mjs";
|
||||
import { Apprecier, MORAL, SITUATION_MORAL } from "./moral/apprecier.mjs";
|
||||
import { Distance } from "./combat/distance.mjs";
|
||||
@@ -140,13 +136,14 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
.reduce(Misc.sum(), 0);
|
||||
}
|
||||
|
||||
listActions({ isAttaque = false, isEquipe = false }) {
|
||||
listActions() {
|
||||
// Recupération des attaques
|
||||
const actions = this.listActionsAttaque()
|
||||
.filter(it => !isEquipe || it.arme.system.equipe)
|
||||
const actions = ReglesOptionnelles.isUsing('armes-equipees')
|
||||
? this.listActionsAttaque().filter(action => action.equipe)
|
||||
: this.listActionsAttaque()
|
||||
|
||||
if (!isAttaque && this.system.attributs.hautrevant.value) {
|
||||
actions.push({ label: "Draconic", action: 'haut-reve', initOnly: true })
|
||||
if (this.system.attributs.hautrevant.value) {
|
||||
actions.push({ label: "Draconic", action: 'haut-reve', initOnly: true, equipe: true })
|
||||
}
|
||||
return actions
|
||||
}
|
||||
@@ -256,7 +253,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
console.log('perte de rêve des enchantements', toUpdate)
|
||||
const messageUpdates = await Promise.all(
|
||||
toUpdate.map(async it => await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-pertereve-enchantement-chateaudormant.hbs`, it)))
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: messageUpdates.reduce(Misc.joining('<br>'))
|
||||
})
|
||||
@@ -322,8 +319,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
await this.setBonusPotionSoin(0);
|
||||
}
|
||||
await this.resetInfoSommeil()
|
||||
ChatMessage.create(message);
|
||||
setTimeout(() => this.sheet.render(), 20)
|
||||
await ChatMessage.create(message)
|
||||
}
|
||||
|
||||
async _recuperationSante(message) {
|
||||
@@ -364,7 +360,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
const message = {
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: ""
|
||||
};
|
||||
}
|
||||
|
||||
await this._recuperationSante(message)
|
||||
await this._recupereMoralChateauDormant(message)
|
||||
@@ -375,12 +371,12 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
await this.retourSust(message)
|
||||
await this.$perteReveEnchantementsChateauDormants()
|
||||
await this.$suppressionLancementsSort()
|
||||
await RdDCoeur.applyCoeurChateauDormant(this, message);
|
||||
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);
|
||||
message.content = `A la fin Chateau Dormant, ${message.content}<br>Un nouveau jour se lève`
|
||||
await ChatMessage.create(message)
|
||||
}
|
||||
await this.resetInfoSommeil();
|
||||
await this.resetInfoSommeil()
|
||||
}
|
||||
|
||||
async resetInfoSommeil() {
|
||||
@@ -536,37 +532,36 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
|
||||
if (!options.grisReve) {
|
||||
ChatMessage.create(message);
|
||||
await ChatMessage.create(message)
|
||||
}
|
||||
if (options.chateauDormant) {
|
||||
await this.$dormirChateauDormant();
|
||||
await this.$dormirChateauDormant()
|
||||
}
|
||||
setTimeout(() => this.sheet.render(), 20)
|
||||
}
|
||||
|
||||
async reveilReveDeDragon(message, heures) {
|
||||
const restant = Math.max(this.system.sommeil?.heures - heures, 0)
|
||||
if (restant > 0) {
|
||||
await this.update({ 'system.sommeil': { heures: restant } });
|
||||
await this.update({ 'system.sommeil': { heures: restant } })
|
||||
}
|
||||
}
|
||||
|
||||
async $dormirDesHeures(message, heures, options) {
|
||||
const dormi = { heures: 0, etat: 'dort', jetsReve: [] };
|
||||
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)
|
||||
await this.$jetRecuperationReve(dormi, message)
|
||||
if (dormi.etat == 'dort' && EffetsDraconiques.isDonDoubleReve(this)) {
|
||||
await this.$jetRecuperationReve(dormi, message);
|
||||
await this.$jetRecuperationReve(dormi, message)
|
||||
}
|
||||
}
|
||||
}
|
||||
return dormi;
|
||||
return dormi
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -583,7 +578,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
else {
|
||||
if (!ReglesOptionnelles.isUsing("recuperation-reve")) {
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: `Pas de récupération de rêve (${reve} points ignorés)`
|
||||
})
|
||||
@@ -891,7 +886,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
await competence.update({ 'system.xp': toXp })
|
||||
await ExperienceLog.add(this, XP_TOPIC.XP, fromXp, toXp, competence.name, true)
|
||||
if (toXp > fromXp) {
|
||||
RdDUtility.checkThanatosXP(competence)
|
||||
await RdDUtility.checkThanatosXP(competence)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -907,7 +902,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
await competence.update({ 'system.xp_sort': toXpSort })
|
||||
await ExperienceLog.add(this, XP_TOPIC.XPSORT, fromXpSort, toXpSort, competence.name, true)
|
||||
if (toXpSort > fromXpSort) {
|
||||
RdDUtility.checkThanatosXP(competence)
|
||||
await RdDUtility.checkThanatosXP(competence)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -954,7 +949,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async distribuerStress(compteur, valeur, motif) {
|
||||
if (game.user.isGM && this.hasPlayerOwner) {
|
||||
if (game.user.isGM && this.isPersonnageJoueur()) {
|
||||
switch (compteur) {
|
||||
case 'stress': case 'experience':
|
||||
await this.addCompteurValue(compteur, valeur, motif);
|
||||
@@ -972,7 +967,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async actionRefoulement(item) {
|
||||
const refoulement = item?.system.refoulement ?? 0;
|
||||
const refoulement = item?.system.refoulement ?? 0
|
||||
if (refoulement > 0) {
|
||||
RdDConfirm.confirmer({
|
||||
settingConfirmer: "confirmation-refouler",
|
||||
@@ -980,8 +975,8 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
title: 'Confirmer la refoulement',
|
||||
buttonLabel: 'Refouler',
|
||||
onAction: async () => {
|
||||
await this.ajouterRefoulement(refoulement, `une queue ${item.name}`);
|
||||
await item.delete();
|
||||
await this.ajouterRefoulement(refoulement, `une queue ${item.name}`)
|
||||
await item.delete()
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -989,16 +984,18 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async ajouterRefoulement(value = 1, refouler) {
|
||||
let refoulement = this.system.reve.refoulement.value + value
|
||||
const refoulement = this.system.reve.refoulement.value + value
|
||||
const roll = new Roll("1d20")
|
||||
await roll.evaluate()
|
||||
await roll.toMessage({ flavor: `${this.name} refoule ${refouler} pour ${value} points de refoulement (total: ${refoulement})` })
|
||||
if (roll.total <= refoulement) {
|
||||
refoulement = 0
|
||||
await this.update({ "system.reve.refoulement.value": 0 })
|
||||
await this.ajouterSouffle({ chat: true })
|
||||
}
|
||||
await this.update({ "system.reve.refoulement.value": refoulement })
|
||||
return roll;
|
||||
else {
|
||||
await this.update({ "system.reve.refoulement.value": refoulement })
|
||||
}
|
||||
return roll
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -1007,7 +1004,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
//souffle.id = undefined; //TBC
|
||||
await this.createEmbeddedDocuments('Item', [souffle])
|
||||
if (options.chat) {
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: this.name + " subit un Souffle de Dragon : " + souffle.name
|
||||
})
|
||||
@@ -1017,22 +1014,19 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async ajouterQueue(options = { chat: false }) {
|
||||
let queue;
|
||||
if (this.system.reve.reve.thanatosused) {
|
||||
queue = await RdDRollTables.getOmbre();
|
||||
const thanatos = this.system.reve.reve.thanatosused;
|
||||
const queue = (thanatos ? await RdDRollTables.getOmbre() : await RdDRollTables.getQueue())
|
||||
if (thanatos) {
|
||||
await this.update({ "system.reve.reve.thanatosused": false })
|
||||
}
|
||||
else {
|
||||
queue = await RdDRollTables.getQueue();
|
||||
}
|
||||
await this.createEmbeddedDocuments('Item', [queue]);
|
||||
await this.createEmbeddedDocuments('Item', [queue])
|
||||
if (options.chat) {
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: this.name + " subit une Queue de Dragon : " + queue.name
|
||||
})
|
||||
}
|
||||
return queue;
|
||||
return queue
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -1096,14 +1090,14 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async reinsertionAleatoire(raison, accessible = tmr => true) {
|
||||
const innaccessible = this.buildTMRInnaccessible();
|
||||
let tmr = await TMRUtility.getTMRAleatoire(tmr => accessible(tmr) && !innaccessible.includes(tmr.coord));
|
||||
ChatMessage.create({
|
||||
const innaccessible = this.buildTMRInnaccessible()
|
||||
let tmr = await TMRUtility.getTMRAleatoire(tmr => accessible(tmr) && !innaccessible.includes(tmr.coord))
|
||||
await ChatMessage.create({
|
||||
content: `${raison} : ré-insertion aléatoire.`,
|
||||
whisper: ChatUtility.getOwners(this)
|
||||
});
|
||||
await this.forcerPositionTMRInconnue(tmr);
|
||||
return tmr;
|
||||
})
|
||||
await this.forcerPositionTMRInconnue(tmr)
|
||||
return tmr
|
||||
}
|
||||
|
||||
async forcerPositionTMRInconnue(tmr) {
|
||||
@@ -1167,14 +1161,14 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
async jetEndurance(resteEndurance = undefined) {
|
||||
const result = super.jetEndurance(resteEndurance);
|
||||
if (result.jetEndurance == 1) {
|
||||
ChatMessage.create({ content: await this._gainXpConstitutionJetEndurance() });
|
||||
await ChatMessage.create({ content: await this._gainXpConstitutionJetEndurance() })
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getSConst() { return RdDCarac.calculSConst(this.getConstitution()) }
|
||||
|
||||
|
||||
async _gainXpConstitutionJetEndurance() {
|
||||
await this.updateCaracXP('constitution', Misc.toInt(this.system.carac.constitution.xp) + 1)
|
||||
return `${this.name} a obtenu 1 sur son Jet d'Endurance et a gagné 1 point d'Expérience en Constitution. Ce point d'XP a été ajouté automatiquement.`;
|
||||
@@ -1188,7 +1182,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
const jetMoral = await this._jetDeMoral(situation, bonmoment)
|
||||
const finMessage = (jetMoral.ajustement == 0 ? "Vous gardez votre moral" : jetMoral.ajustement > 0 ? "Vous gagnez du moral" : "Vous perdez du moral");
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: `${finMessage} - jet ${jetMoral.succes ? "réussi" : "manqué"} en situation ${SITUATION_MORAL[situation] ?? situation} (${jetMoral.jet}/${jetMoral.difficulte}).`
|
||||
})
|
||||
@@ -1214,22 +1208,22 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async moralIncDec(ajustement, bonmoment = "") {
|
||||
let moral = parseInt(this.system.compteurs.moral.value)
|
||||
const moral = parseInt(this.system.compteurs.moral.value);
|
||||
if (ajustement != 0) {
|
||||
if (ajustement > 0 && bonmoment != "" && bonmoment != undefined) {
|
||||
await this.update({ 'system.compteurs.bonmoments': [...this.system.compteurs.bonmoments, bonmoment] })
|
||||
}
|
||||
const moralTheorique = moral + ajustement
|
||||
if (moralTheorique > 3) { // exaltation
|
||||
const exaltation = parseInt(this.system.compteurs.exaltation.value) + moralTheorique - 3
|
||||
await this.update({ 'system.compteurs.exaltation.value': exaltation })
|
||||
const newExaltation = parseInt(this.system.compteurs.exaltation.value) + Math.max(0, moralTheorique - 3)
|
||||
const newDissolution = parseInt(this.system.compteurs.dissolution.value) + Math.max(0, - moralTheorique - 3)
|
||||
const newMoral = Math.max(-3, Math.min(moralTheorique, 3))
|
||||
const moralUpdates = {
|
||||
'system.compteurs.exaltation.value': newExaltation,
|
||||
'system.compteurs.dissolution.value': newDissolution,
|
||||
'system.compteurs.moral.value': newMoral
|
||||
}
|
||||
if (moralTheorique < -3) { // dissolution
|
||||
const dissolution = parseInt(this.system.compteurs.dissolution.value) - 3 - moralTheorique
|
||||
await this.update({ 'system.compteurs.dissolution.value': dissolution })
|
||||
if (ajustement > 0 && bonmoment != "" && bonmoment != undefined && !this.system.compteurs.bonmoments.includes(bonmoment)) {
|
||||
moralUpdates['system.compteurs.bonmoments'] = [...this.system.compteurs.bonmoments, bonmoment]
|
||||
}
|
||||
moral = Math.max(-3, Math.min(moralTheorique, 3));
|
||||
await this.update({ 'system.compteurs.moral.value': moral })
|
||||
await this.update(moralUpdates)
|
||||
return newMoral
|
||||
}
|
||||
return moral
|
||||
}
|
||||
@@ -1492,7 +1486,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
exaltation: exaltation
|
||||
};
|
||||
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-transformer-stress.hbs`, stressRollData)
|
||||
});
|
||||
@@ -1559,7 +1553,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
xp: carac.xp
|
||||
}
|
||||
if (display) {
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-carac-xp.hbs`, checkXp)
|
||||
});
|
||||
@@ -1571,7 +1565,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async checkCompetenceXP(compName, newXP, display = true) {
|
||||
return this.getCompetence(compName)?.checkCompetenceXP( newXP, display)
|
||||
return this.getCompetence(compName)?.checkCompetenceXP(newXP, display)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -1594,7 +1588,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
ChatUtility.blindMessageToGM({ content: content })
|
||||
}
|
||||
else {
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: content
|
||||
});
|
||||
@@ -1698,22 +1692,22 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
isMauvaiseRencontre() { // Gestion queue/souffle 'Mauvaise Rencontre en Perpective'
|
||||
let addMsg = "";
|
||||
let rencSpecial = EffetsDraconiques.mauvaiseRencontre(this);
|
||||
async isMauvaiseRencontre() { // Gestion queue/souffle 'Mauvaise Rencontre en Perpective'
|
||||
let addMsg = ""
|
||||
let rencSpecial = EffetsDraconiques.mauvaiseRencontre(this)
|
||||
if (rencSpecial) {
|
||||
if (rencSpecial.type != 'souffle') {
|
||||
this.deleteEmbeddedDocuments('Item', [rencSpecial.id]); // Suppression dans la liste des queues
|
||||
addMsg = " La queue a été supprimée de votre fiche automatiquement";
|
||||
await this.deleteEmbeddedDocuments('Item', [rencSpecial.id]) // Suppression dans la liste des queues
|
||||
addMsg = " La queue a été supprimée de votre fiche automatiquement"
|
||||
} else {
|
||||
addMsg = " Vous devez gérer manuellement le décompte de mauvaises rencontres.";
|
||||
addMsg = " Vous devez gérer manuellement le décompte de mauvaises rencontres."
|
||||
}
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
content: "Vous êtes sous le coup d'une Mauvaise Rencontre en Persective." + addMsg,
|
||||
whisper: ChatUtility.getOwners(this)
|
||||
});
|
||||
})
|
||||
}
|
||||
return rencSpecial;
|
||||
return rencSpecial
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -1723,7 +1717,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
ChatMessage.create({
|
||||
content: `Vous êtes sous le coup d'Inertie Draconique : vous perdrez ${countInertieDraconique + 1} cases de Fatigue par déplacement au lieu d'une.`,
|
||||
whisper: ChatUtility.getOwners(this)
|
||||
});
|
||||
})
|
||||
}
|
||||
return countInertieDraconique + 1;
|
||||
}
|
||||
@@ -1731,11 +1725,11 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
/* -------------------------------------------- */
|
||||
async checkSoufflePeage(tmr) {
|
||||
if ((tmr.type == 'pont' || tmr.type == 'cite') && EffetsDraconiques.isPeage(this)) {
|
||||
await this.reveActuelIncDec(-1);
|
||||
ChatMessage.create({
|
||||
await this.reveActuelIncDec(-1)
|
||||
await ChatMessage.create({
|
||||
content: "Vous êtes sous le coup d'un Péage : l'entrée sur cette case vous a coûté 1 Point de Rêve (déduit automatiquement).",
|
||||
whisper: ChatUtility.getOwners(this)
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1761,7 +1755,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
if (reveActuel > rollData.depenseReve) {
|
||||
// Incrémenter/gére le bonus de case
|
||||
RdDItemSort.incrementBonusCase(this, selectedSort, rollData.tmr.coord)
|
||||
await RdDItemSort.incrementBonusCase(this, selectedSort, rollData.tmr.coord)
|
||||
|
||||
if (rollData.isSortReserve) {
|
||||
await this.sortMisEnReserve(selectedSort, rollData.competence, rollData.tmr.coord, Number(selectedSort.system.ptreve_reel))
|
||||
@@ -1794,7 +1788,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
await RdDRollResult.displayRollData(rollData, this, 'chat-resultat-sort.hbs')
|
||||
|
||||
if (reveActuel == 0) { // 0 points de reve
|
||||
ChatMessage.create({ content: this.name + " est réduit à 0 Points de Rêve, et tombe endormi !" })
|
||||
await ChatMessage.create({ content: this.name + " est réduit à 0 Points de Rêve, et tombe endormi !" })
|
||||
}
|
||||
if (!rollData.isSortReserve || !rolled.isSuccess) {
|
||||
this.tmrApp?.close()
|
||||
@@ -1879,7 +1873,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: { allowed: [PART_COMP], current: PART_COMP },
|
||||
type: { allowed: [ROLL_TYPE_COMP], current: ROLL_TYPE_COMP },
|
||||
selected: {
|
||||
carac: { key: caracName },
|
||||
comp: { key: compName, forced: options.forced },
|
||||
@@ -1918,7 +1912,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
selected: { tache: { key: tache.id, forced: options.forced } },
|
||||
type: { allowed: [PART_TACHE], current: PART_TACHE }
|
||||
type: { allowed: [ROLL_TYPE_TACHE], current: ROLL_TYPE_TACHE }
|
||||
}
|
||||
return await RollDialog.create(rollData, options)
|
||||
}
|
||||
@@ -2131,18 +2125,22 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollAppelChance(onSuccess = () => { }, onEchec = () => { }) {
|
||||
await this.openRollDialog({
|
||||
name: 'appelChance',
|
||||
label: 'Appel à la chance',
|
||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.hbs',
|
||||
rollData: { selectedCarac: this.getCaracByName('chance-actuelle'), surprise: '' },
|
||||
callbacks: [{ action: r => this.$appelChanceResult(r, onSuccess, onEchec) }]
|
||||
});
|
||||
|
||||
return await RollDialog.create(
|
||||
{
|
||||
ids: { actorId: this.id },
|
||||
type: { allowed: [ROLL_TYPE_APPEL_CHANCE], current: ROLL_TYPE_APPEL_CHANCE },
|
||||
},
|
||||
{
|
||||
onRollDone: (dialog, roll) => RollDialog.onRollDoneClose(dialog, roll),
|
||||
callbacks: [
|
||||
async roll => await this.$onAppelChance(roll, onSuccess, onEchec)
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async $appelChanceResult(rollData, onSuccess, onEchec) {
|
||||
await RdDRollResult.displayRollData(rollData, this, 'chat-resultat-appelchance.hbs')
|
||||
async $onAppelChance(rollData, onSuccess, onEchec) {
|
||||
if (rollData.rolled.isSuccess) {
|
||||
await this.setFlag(SYSTEM_RDD, 'utilisationChance', true);
|
||||
await this.chanceActuelleIncDec(-1);
|
||||
@@ -2157,7 +2155,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
async appelDestinee(onSuccess = () => { }, onEchec = () => { }) {
|
||||
let destinee = this.system.compteurs.destinee?.value ?? 0;
|
||||
if (destinee > 0) {
|
||||
ChatMessage.create({ content: `<span class="rdd-roll-part">${this.name} a fait appel à la Destinée !</span>` });
|
||||
await ChatMessage.create({ content: `<span class="rdd-roll-part">${this.name} a fait appel à la Destinée !</span>` });
|
||||
await this.update({ 'system.compteurs.destinee.value ': destinee - 1 })
|
||||
onSuccess()
|
||||
}
|
||||
@@ -2192,10 +2190,10 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
if (this.checkDesirLancinant()) {
|
||||
// Cas de désir lancinant, pas d'expérience sur particulière
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
content: `Vous souffrez au moins d'un Désir Lancinant, vous ne pouvez pas gagner d'expérience sur une Particulière tant que le désir n'est pas assouvi`,
|
||||
whisper: ChatUtility.getOwners(this)
|
||||
});
|
||||
})
|
||||
return []
|
||||
}
|
||||
|
||||
@@ -2323,15 +2321,15 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
countMonteeLaborieuse() { // Return +1 par queue/ombre/souffle Montée Laborieuse présente
|
||||
async countMonteeLaborieuse() { // Return +1 par queue/ombre/souffle Montée Laborieuse présente
|
||||
let countMonteeLaborieuse = EffetsDraconiques.countMonteeLaborieuse(this);
|
||||
if (countMonteeLaborieuse > 0) {
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
content: `Vous êtes sous le coup d'une Montée Laborieuse : vos montées en TMR coûtent ${countMonteeLaborieuse} Point de Rêve de plus.`,
|
||||
whisper: ChatUtility.getOwners(this)
|
||||
});
|
||||
}
|
||||
return countMonteeLaborieuse;
|
||||
return countMonteeLaborieuse
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -2374,9 +2372,9 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
async _doDisplayTMR(mode) {
|
||||
let isRapide = mode == "rapide";
|
||||
if (mode != "visu") {
|
||||
let minReveValue = (isRapide && !EffetsDraconiques.isDeplacementAccelere(this) ? 3 : 2) + this.countMonteeLaborieuse();
|
||||
let minReveValue = (isRapide && !EffetsDraconiques.isDeplacementAccelere(this) ? 3 : 2) + (await this.countMonteeLaborieuse())
|
||||
if (this.getReveActuel() < minReveValue) {
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
content: `Vous n'avez les ${minReveValue} Points de Reve nécessaires pour monter dans les Terres Médianes`,
|
||||
whisper: ChatUtility.getOwners(this)
|
||||
});
|
||||
@@ -2418,15 +2416,16 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
if (!viewOnly) {
|
||||
await this.supprimerSignesDraconiques(it => it.system.ephemere && it.system.duree == '1 round', { render: false })
|
||||
await this.setEffect(STATUSES.StatusDemiReve, false)
|
||||
ChatUtility.tellToUserAndGM(message)
|
||||
await ChatUtility.tellToUserAndGM(message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async supprimerSignesDraconiques(filter = it => true, options = { render: true }) {
|
||||
const signes = this.itemTypes[ITEM_TYPES.signedraconique].filter(filter)
|
||||
if (signes.length > 0) {
|
||||
this.deleteEmbeddedDocuments("Item", signes.map(item => item.id), options)
|
||||
const ids = this.itemTypes[ITEM_TYPES.signedraconique].filter(filter)
|
||||
.map(it => it.id)
|
||||
if (ids.length > 0) {
|
||||
await this.deleteEmbeddedDocuments("Item", ids, options)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2464,9 +2463,9 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
verifierForceMin(item) {
|
||||
async verifierForceMin(item) {
|
||||
if (item.type == 'arme' && item.system.force > parseInt(this.system.carac.force.value)) {
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
content: `<strong>${this.name} s'est équipé(e) de l'arme ${item.name}, mais n'a pas une force suffisante pour l'utiliser normalement </strong>
|
||||
(${item.system.force} nécessaire pour une Force de ${this.system.carac.force.value})`
|
||||
});
|
||||
@@ -2476,11 +2475,11 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
/* -------------------------------------------- */
|
||||
async equiperObjet(item) {
|
||||
if (item?.isEquipable()) {
|
||||
const isEquipe = !item.system.equipe;
|
||||
await item.update({ "system.equipe": isEquipe })
|
||||
const newEquipe = !item.system.equipe;
|
||||
await item.update({ "system.equipe": newEquipe })
|
||||
this.computeEncTotal()
|
||||
if (isEquipe)
|
||||
this.verifierForceMin(item)
|
||||
if (newEquipe)
|
||||
await this.verifierForceMin(item)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2742,25 +2741,25 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async consommerPotionSoin(potion) {
|
||||
potion.alias = this.name;
|
||||
potion.supprimer = true;
|
||||
potion.alias = this.name
|
||||
potion.supprimer = true
|
||||
|
||||
if (potion.system.magique) {
|
||||
// Gestion de la résistance:
|
||||
potion.rolled = await RdDResolutionTable.roll(this.getReveActuel(), -8);
|
||||
potion.rolled = await RdDResolutionTable.roll(this.getReveActuel(), -8)
|
||||
if (potion.rolled.isEchec) {
|
||||
await this.reveActuelIncDec(-1);
|
||||
potion.guerisonData = await this.buildPotionGuerisonList(potion.system.puissance);
|
||||
potion.guerisonMinutes = potion.guerisonData.pointsConsommes * 5;
|
||||
potion.guerisonData = await this.buildPotionGuerisonList(potion.system.puissance)
|
||||
potion.guerisonMinutes = potion.guerisonData.pointsConsommes * 5
|
||||
}
|
||||
}
|
||||
if (!potion.system.magique || potion.rolled.isSuccess) {
|
||||
await this.setBonusPotionSoin(potion.system.herbebonus);
|
||||
await this.setBonusPotionSoin(potion.system.herbebonus)
|
||||
}
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-soin.hbs`, potion)
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
async setBonusPotionSoin(bonus) {
|
||||
@@ -2794,10 +2793,10 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
if (!potion.system.magique || potion.rolled.isSuccess) {
|
||||
this.bonusRepos = potion.system.herbebonus;
|
||||
}
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-repos.hbs`, potion)
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -2819,7 +2818,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
await this.createEmbeddedDocuments('Item', [newPotion])
|
||||
await this.diminuerQuantiteObjet(herbeData._id, herbeData.nbBrins)
|
||||
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-fabriquer-potion-base.hbs`, {
|
||||
alias: this.getAlias(),
|
||||
@@ -2837,19 +2836,19 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async consommerPotionGenerique(potion) {
|
||||
potion.alias = this.name;
|
||||
potion.alias = this.name
|
||||
|
||||
if (potion.system.magique) {
|
||||
// Gestion de la résistance:
|
||||
potion.rolled = await RdDResolutionTable.roll(this.getReveActuel(), -8);
|
||||
if (potion.rolled.isEchec) {
|
||||
await this.reveActuelIncDec(-1);
|
||||
await this.reveActuelIncDec(-1)
|
||||
}
|
||||
}
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-generique.hbs`, potion)
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -2912,7 +2911,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
let draconique = Draconique.all().find(it => it.match(item));
|
||||
if (draconique) {
|
||||
await draconique.onActorCreateOwned(this, item)
|
||||
this.notifyGestionTeteSouffleQueue(item, draconique.manualMessage());
|
||||
await this.notifyGestionTeteSouffleQueue(item, draconique.manualMessage());
|
||||
}
|
||||
await this.setInfoSommeilInsomnie();
|
||||
}
|
||||
@@ -2968,27 +2967,27 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
notifyGestionTeteSouffleQueue(item, manualMessage = true) {
|
||||
ChatMessage.create({
|
||||
async notifyGestionTeteSouffleQueue(item, manualMessage = true) {
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: `${this.name} a reçu un/une ${item.type}: ${item.name}, qui ${manualMessage ? "n'est pas" : "est"} géré(e) automatiquement. ${manualMessage ? manualMessage : ''}`
|
||||
});
|
||||
}
|
||||
|
||||
async nouvelleIncarnation() {
|
||||
let incarnation = this.toObject();
|
||||
let incarnation = this.toObject()
|
||||
|
||||
incarnation.items = Array.from(this.items.filter(it => it.type == ITEM_TYPES.competence),
|
||||
incarnation.items = Array.from(this.itemTypes[ITEM_TYPES.competence],
|
||||
it => {
|
||||
it = it.toObject();
|
||||
it.id = undefined;
|
||||
it.system.niveau = it.system.base;
|
||||
it.system.niveau_archetype = Math.max(it.system.niveau + (it.system.xp > 0 ? 1 : 0), it.system.niveau_archetype);
|
||||
it.system.xp = 0;
|
||||
it.system.xp_sort = 0;
|
||||
it.system.default_diffLibre = 0;
|
||||
return it;
|
||||
});
|
||||
it = it.toObject()
|
||||
it.id = undefined
|
||||
it.system.niveau = it.system.base
|
||||
it.system.niveau_archetype = Math.max(it.system.niveau + (it.system.xp > 0 ? 1 : 0), it.system.niveau_archetype)
|
||||
it.system.xp = 0
|
||||
it.system.xp_sort = 0
|
||||
it.system.default_diffLibre = 0
|
||||
return it
|
||||
})
|
||||
|
||||
incarnation.name = 'Réincarnation de ' + incarnation.name
|
||||
incarnation.system = {
|
||||
@@ -3003,12 +3002,57 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
'reve.reve.value': this.system.carac.reve.value,
|
||||
subacteurs: { suivants: [], montures: [], vehicules: [] },
|
||||
}
|
||||
incarnation = await RdDBaseActor.create(incarnation);
|
||||
await incarnation.deleteEmbeddedDocuments('ActiveEffect', incarnation.getEmbeddedCollection("ActiveEffect").map(it => it.id));
|
||||
await incarnation.remiseANeuf();
|
||||
incarnation.sheet.render(true);
|
||||
incarnation = await RdDBaseActor.create(incarnation)
|
||||
await incarnation.deleteEmbeddedDocuments('ActiveEffect', incarnation.getEmbeddedCollection("ActiveEffect").map(it => it.id))
|
||||
await incarnation.remiseANeuf()
|
||||
incarnation.sheet.render(true)
|
||||
}
|
||||
|
||||
async repartitionArchetypeAleatoire() {
|
||||
|
||||
const nivArchetypeDisponibles = RdDItemCompetence.computeResumeArchetype(this.itemTypes[ITEM_TYPES.competence])
|
||||
.filter(it => it.reste > 0)
|
||||
|
||||
function proba(nivDispo, niveauActuel) {
|
||||
return niveauActuel > 0 ? (nivDispo.reste + 3) : nivDispo.reste
|
||||
}
|
||||
async function takeNiveauArchetypeRandom(niveauMin) {
|
||||
const potential = nivArchetypeDisponibles.filter(it => it.niveau >= niveauMin)
|
||||
const totalChances = potential.map(it => proba(it, niveauMin)).reduce(Misc.sum(), 0)
|
||||
if (totalChances > 0) {
|
||||
let random = await Misc.random(totalChances)
|
||||
for (const selected of potential) {
|
||||
if (selected.reste > 0) {
|
||||
const chances = proba(selected, niveauMin)
|
||||
if (random <= chances) {
|
||||
selected.nombre++
|
||||
selected.reste--
|
||||
return selected.niveau
|
||||
}
|
||||
random -= chances
|
||||
}
|
||||
}
|
||||
}
|
||||
return Math.max(0, niveauMin)
|
||||
}
|
||||
|
||||
const compsByNiveau = Misc.classify(
|
||||
this.itemTypes[ITEM_TYPES.competence].filter(it => it.system.niveau_archetype <= 0),
|
||||
it => Math.max(0, it.system.niveau))
|
||||
|
||||
const niveaux = Object.keys(compsByNiveau).sort(Misc.descending())
|
||||
const updates = []
|
||||
|
||||
for (let i = 0; i < niveaux.length; i++) {
|
||||
const competencesDuNiveau = Misc.shuffled(compsByNiveau[niveaux[i]])
|
||||
for (let j = 0; j < competencesDuNiveau.length; j++) {
|
||||
const competence = competencesDuNiveau[j]
|
||||
const nivArchetype = await takeNiveauArchetypeRandom(competence.system.niveau)
|
||||
updates.push({ _id: competence.id, 'system.niveau_archetype': nivArchetype })
|
||||
}
|
||||
}
|
||||
await this.updateEmbeddedDocuments('Item', updates)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _rollArtV2(oeuvreId) {
|
||||
@@ -3016,7 +3060,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
selected: { oeuvre: { key: oeuvre.id } },
|
||||
type: { allowed: [PART_OEUVRE], current: PART_OEUVRE, },
|
||||
type: { allowed: [ROLL_TYPE_OEUVRE], current: ROLL_TYPE_OEUVRE, },
|
||||
}
|
||||
return await RollDialog.create(rollData)
|
||||
}
|
||||
@@ -3118,7 +3162,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: { allowed: [PART_CUISINE], current: PART_CUISINE },
|
||||
type: { allowed: [ROLL_TYPE_CUISINE], current: ROLL_TYPE_CUISINE },
|
||||
selected: {
|
||||
cuisine: { key: recette.id }
|
||||
}
|
||||
@@ -3168,7 +3212,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
if (item.getUtilisationCuisine() == 'brut' && OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: { allowed: [PART_CUISINE], current: PART_CUISINE },
|
||||
type: { allowed: [ROLL_TYPE_CUISINE], current: ROLL_TYPE_CUISINE },
|
||||
selected: {
|
||||
cuisine: { key: item.id }
|
||||
}
|
||||
|
||||
@@ -26,9 +26,8 @@ import { BASE_CORPS_A_CORPS, BASE_ESQUIVE, CATEGORIES_COMPETENCES_CREATURES } fr
|
||||
import { RollDataAjustements } from "../rolldata-ajustements-v1.js";
|
||||
import { MappingCreatureArme } from "../item/mapping-creature-arme.mjs";
|
||||
import RollDialog from "../roll/roll-dialog.mjs";
|
||||
import { DEFAULT_ROLL_TYPES, DIFF, ROLL_TYPE_ATTAQUE } from "../roll/roll-constants.mjs";
|
||||
import { DEFAULT_ROLL_TYPES, DIFF, ROLL_TYPE_ATTAQUE, ROLL_TYPE_COMP, ROLL_TYPE_REVE_RESISTANCE } from "../roll/roll-constants.mjs";
|
||||
import { OptionsAvancees, ROLL_DIALOG_V2 } from "../settings/options-avancees.js";
|
||||
import { PART_COMP } from "../roll/roll-part-comp.mjs";
|
||||
import { RdDInitiative } from "../initiative.mjs";
|
||||
import { RdDItemCompetenceCreature } from "../item-competencecreature.js";
|
||||
import { RdDPossessionV2 } from "../rdd-possession-v2.mjs";
|
||||
@@ -145,7 +144,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
}
|
||||
}
|
||||
|
||||
listActions({ isAttaque = false, isEquipe = false }) {
|
||||
listActions() {
|
||||
return this.itemTypes[ITEM_TYPES.competencecreature]
|
||||
.filter(it => it.isAttaque())
|
||||
.map(it => it.attaqueCreature())
|
||||
@@ -156,7 +155,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
async remiseANeuf() { }
|
||||
async ajoutExperience(rollData, hideChatMessage = 'show') { }
|
||||
|
||||
computeResumeBlessure() { return []}
|
||||
computeResumeBlessure() { return [] }
|
||||
countBlessures(filter = it => !it.isContusion()) { return 0 }
|
||||
async santeIncDec(name, inc, isCritique) { }
|
||||
|
||||
@@ -169,10 +168,11 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
}
|
||||
|
||||
async finDeRoundSuppressionEffetsTermines(options) {
|
||||
for (let effect of this.getEffects()) {
|
||||
const effects = this.getEffects();
|
||||
for (let effect of effects) {
|
||||
if (effect.duration.type !== 'none' && (effect.duration.remaining <= 0 || options.terminer)) {
|
||||
await effect.delete();
|
||||
ChatMessage.create({ content: `${this.getAlias()} n'est plus ${Misc.lowerFirst(game.i18n.localize(effect.system.label))} !` });
|
||||
await effect.delete()
|
||||
await ChatMessage.create({ content: `${this.getAlias()} n'est plus ${Misc.lowerFirst(game.i18n.localize(effect.system.label))} !` })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -316,7 +316,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
const competence = this.getCompetence(compName);
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: { allowed: DEFAULT_ROLL_TYPES, current: PART_COMP },
|
||||
type: { allowed: DEFAULT_ROLL_TYPES, current: ROLL_TYPE_COMP },
|
||||
selected: {
|
||||
carac: { key: caracName },
|
||||
comp: { key: competence.name },
|
||||
@@ -383,7 +383,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
ids: { actorId: this.id },
|
||||
type: {
|
||||
allowed: DEFAULT_ROLL_TYPES,
|
||||
current: PART_COMP,
|
||||
current: ROLL_TYPE_COMP,
|
||||
},
|
||||
selected: {
|
||||
diff: { type: DIFF.DEFAUT }
|
||||
@@ -411,13 +411,33 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
})
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async rollReveResistance(diff = -8) {
|
||||
return await RollDialog.create(
|
||||
{
|
||||
ids: { actorId: this.id },
|
||||
type: {
|
||||
allowed: [ROLL_TYPE_REVE_RESISTANCE],
|
||||
current: ROLL_TYPE_REVE_RESISTANCE,
|
||||
resistance: true
|
||||
},
|
||||
selected: {
|
||||
carac: { key: CARACS.REVE_ACTUEL, forced: true },
|
||||
comp: { key: undefined, forced: true },
|
||||
diff: { type: DIFF.DEFAUT, value: diff }
|
||||
}
|
||||
},
|
||||
{
|
||||
onRollDone: (dialog, roll) => RollDialog.onRollDoneClose(dialog, roll)
|
||||
})
|
||||
}
|
||||
|
||||
async rollReveActuel({ diff = 0, resistance = false }) {
|
||||
if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: {
|
||||
allowed: [PART_COMP],
|
||||
current: PART_COMP,
|
||||
allowed: [ROLL_TYPE_REVE_RESISTANCE],
|
||||
current: ROLL_TYPE_REVE_RESISTANCE,
|
||||
resistance: resistance
|
||||
},
|
||||
selected: {
|
||||
@@ -439,8 +459,8 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: {
|
||||
allowed: options.resistance ? [PART_COMP] : DEFAULT_ROLL_TYPES,
|
||||
current: PART_COMP,
|
||||
allowed: options.resistance ? [ROLL_TYPE_COMP] : DEFAULT_ROLL_TYPES,
|
||||
current: options.resistance ? ROLL_TYPE_COMP : ROLL_TYPE_COMP,
|
||||
resistance: options.resistance
|
||||
},
|
||||
selected: {
|
||||
@@ -615,7 +635,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
RdDPossessionV2.rollAttaquePossession(this)
|
||||
}
|
||||
|
||||
verifierForceMin(item) { }
|
||||
async verifierForceMin(item) { }
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async encaisser() { await RdDEncaisser.encaisser(this) }
|
||||
@@ -675,10 +695,10 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
if (!encaissement.hasPlayerOwner && encaissement.endurance != 0) {
|
||||
encaissement = foundry.utils.duplicate(encaissement)
|
||||
encaissement.isGM = true
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getGMs(),
|
||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-resultat-encaissement.hbs', encaissement)
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ export class RdDBaseActorSangSheet extends RdDBaseActorReveSheet {
|
||||
async jetEndurance() {
|
||||
const endurance = this.actor.getEnduranceActuelle()
|
||||
const result = await this.actor.jetEndurance(endurance);
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
content: `Jet d'Endurance : ${result.jetEndurance} / ${endurance}
|
||||
<br>${this.actor.name} a ${result.sonne ? 'échoué' : 'réussi'} son Jet d'Endurance ${result.sonne ? 'et devient Sonné' : ''}`,
|
||||
whisper: ChatUtility.getOwners(this.actor)
|
||||
|
||||
@@ -351,11 +351,10 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
|
||||
/* -------------------------------------------- */
|
||||
async jetDeVie() {
|
||||
if (this.isDead()) {
|
||||
ChatMessage.create({
|
||||
return await ChatMessage.create({
|
||||
content: `Jet de Vie: ${this.getAlias()} est déjà mort, ce n'est pas la peine d'en rajouter !!!!!`,
|
||||
whisper: ChatUtility.getOwners(this)
|
||||
})
|
||||
return
|
||||
}
|
||||
const jetDeVie = await RdDDice.roll("1d20");
|
||||
const sConst = this.getSConst();
|
||||
@@ -380,7 +379,7 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
|
||||
else if (prochainJet > 0) {
|
||||
msgText += `<br>Prochain jet de vie dans ${prochainJet} ${isCritique ? 'round' : 'minute'}${prochainJet > 1 ? 's' : ''} ${isCritique ? '(état critique)' : '(état grave)'}`
|
||||
}
|
||||
ChatMessage.create({
|
||||
return await ChatMessage.create({
|
||||
content: msgText,
|
||||
whisper: ChatUtility.getOwners(this)
|
||||
})
|
||||
|
||||
@@ -450,7 +450,7 @@ export class RdDBaseActor extends Actor {
|
||||
msg = "Vous n'avez pas assez d'argent pour payer cette somme !";
|
||||
}
|
||||
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: msg
|
||||
})
|
||||
@@ -494,7 +494,7 @@ export class RdDBaseActor extends Actor {
|
||||
await Monnaie.optimiserFortune(this, sols + this.getFortune());
|
||||
|
||||
RdDAudio.PlayContextAudio("argent"); // Petit son
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: `Vous avez reçu <strong>${sols} Sols</strong> ${fromActor ? " de " + fromActor.name : ''}, qui ont été ajoutés à votre argent.`
|
||||
})
|
||||
@@ -548,7 +548,7 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
const chatAchatItem = foundry.utils.duplicate(achat.vente);
|
||||
chatAchatItem.quantiteTotal = quantite;
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
user: achat.userId,
|
||||
speaker: { alias: (acheteur ?? vendeur).getAlias() },
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
@@ -893,7 +893,7 @@ export class RdDBaseActor extends Actor {
|
||||
system: { description: this.system.description }
|
||||
}
|
||||
renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.hbs', chatData)
|
||||
.then(html => ChatMessage.create(RdDUtility.chatDataSetup(html, modeOverride)));
|
||||
.then(async html => await ChatMessage.create(RdDUtility.chatDataSetup(html, modeOverride)));
|
||||
}
|
||||
|
||||
actionImpossible(action) {
|
||||
@@ -914,11 +914,7 @@ 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 [] }
|
||||
listActions() { return [] }
|
||||
|
||||
listActionsPossessions() {
|
||||
return this.itemTypes[ITEM_TYPES.possession]
|
||||
|
||||
@@ -5,25 +5,80 @@ import { RdDDice } from "../../rdd-dice.js";
|
||||
import { RdDNameGen } from "../../rdd-namegen.js";
|
||||
import { RdDTimestamp } from "../../time/rdd-timestamp.js";
|
||||
|
||||
const PATHS = [
|
||||
'name',
|
||||
'system.sexe',
|
||||
'system.age',
|
||||
'system.taille',
|
||||
'system.poids',
|
||||
'system.main',
|
||||
'system.heure',
|
||||
'system.cheveux',
|
||||
'system.yeux'
|
||||
]
|
||||
|
||||
const RANDOM_VALUES = {
|
||||
'system.sexe': { 'masculin': 1, 'féminin': 1 },
|
||||
'system.main': { 'droitier': 51, 'gaucher': 15, 'ambidextre': 6 },
|
||||
'system.cheveux': { 'noirs': 2, 'bruns': 5, 'châtains': 3, 'châtain clair': 5, 'blonds': 4, 'blond platine': 1, 'roux carotte': 1, 'roux cuivré': 3, 'chauve': 1 },
|
||||
'system.yeux': { 'noirs': 2, 'noisette': 3, 'brun-vert': 4, 'verts': 3, 'bleu clair': 3, 'bleu gris': 2, 'gris': 1, 'mauves': 1, 'indigos': 1 },
|
||||
async function randomFrom(values) {
|
||||
const max = Object.values(values).reduce(Misc.sum(), 0)
|
||||
const total = await RdDDice.rollTotal(`1d${max}`)
|
||||
let sum = 0
|
||||
for (let entry of Object.entries(values)) {
|
||||
sum = sum + entry[1]
|
||||
if (sum >= total) {
|
||||
return entry[0]
|
||||
}
|
||||
}
|
||||
return Object.keys(values)[0]
|
||||
}
|
||||
|
||||
async function randomTailleCm(taille) {
|
||||
const infoTaille = RdDCarac.getCaracDerivee(taille)
|
||||
const infoTailleSup = RdDCarac.getCaracDerivee(taille + 1)
|
||||
const variation = (infoTailleSup.taille - infoTaille.taille) + Math.floor((infoTaille.poidsMax - infoTaille.poidsMin) / 2)
|
||||
const base = infoTaille.taille
|
||||
const total = await RdDDice.rollTotal(`1d${variation} -1d ${variation} + ${base}`)
|
||||
const cm = total % 100
|
||||
const dm = cm < 10 ? '0' : ''
|
||||
const m = (total - cm) / 100
|
||||
return `${m}m${dm}${cm}`
|
||||
}
|
||||
|
||||
async function randomPoidsKg(taille) {
|
||||
const infoTaille = RdDCarac.getCaracDerivee(taille)
|
||||
const range = infoTaille.poidsMax - infoTaille.poidsMin + 1
|
||||
const total = await RdDDice.rollTotal(`1d${range} + ${infoTaille.poidsMin}`)
|
||||
return total + ' kg'
|
||||
}
|
||||
|
||||
async function randomHeure() {
|
||||
return RdDTimestamp.defHeure(await RdDDice.rollHeure({ rollMode: "selfroll", showDice: SHOW_DICE })).key
|
||||
}
|
||||
|
||||
const CONTROL_UNKNOWN = { name: 'unknown', path: '', getter: (act) => { undefined }, random: async act => undefined }
|
||||
const TABLE_SEXES = { 'masculin': 1, 'féminin': 1 };
|
||||
const TABLE_MAINS = { 'droitier': 51, 'gaucher': 15, 'ambidextre': 6 };
|
||||
const TABLE_COULEURS_CHEVEUX = {
|
||||
'noirs': 2,
|
||||
'bruns': 5,
|
||||
'châtains': 3,
|
||||
'châtain clair': 5,
|
||||
'blonds': 4,
|
||||
'blond platine': 1,
|
||||
'roux carotte': 1,
|
||||
'roux cuivré': 3,
|
||||
'chauve': 1
|
||||
};
|
||||
const TABLE_COULEURS_YEUX = {
|
||||
'noirs': 2,
|
||||
'noisette': 3,
|
||||
'brun-vert': 4,
|
||||
'verts': 3,
|
||||
'bleu clair': 3,
|
||||
'bleu gris': 2,
|
||||
'gris': 1,
|
||||
'mauves': 1,
|
||||
'indigos': 1
|
||||
};
|
||||
|
||||
const CONTROLS = [
|
||||
{ name: 'name', path: 'name', getter: (act) => act.name, random: async act => await RdDNameGen.generate() },
|
||||
{ name: 'sexe', path: 'system.sexe', getter: act => act.system.sexe, random: async act => await randomFrom(TABLE_SEXES) },
|
||||
{ name: 'age', path: 'system.age', getter: act => act.system.age, random: async act => await RdDDice.rollTotal('(2d4kl)*10 + 1d7xo + 2d20kl') },
|
||||
{ name: 'taille', path: 'system.taille', getter: act => act.system.taille, random: async act => await randomTailleCm(act.system.carac.taille.value) },
|
||||
{ name: 'poids', path: 'system.poids', getter: act => act.system.poids, random: async act => await randomPoidsKg(act.system.carac.taille.value) },
|
||||
{ name: 'main', path: 'system.main', getter: act => act.system.main, random: async act => await randomFrom(TABLE_MAINS) },
|
||||
{ name: 'heure', path: 'system.heure', getter: act => act.system.heure, random: async act => await randomHeure() },
|
||||
{ name: 'cheveux', path: 'system.cheveux', getter: act => act.system.cheveux, random: async act => await randomFrom(TABLE_COULEURS_CHEVEUX) },
|
||||
{ name: 'yeux', path: 'system.yeux', getter: act => act.system.yeux, random: async act => await randomFrom(TABLE_COULEURS_YEUX) },
|
||||
]
|
||||
|
||||
export class AppPersonnageAleatoire extends FormApplication {
|
||||
static preloadHandlebars() {
|
||||
foundry.applications.handlebars.loadTemplates([
|
||||
@@ -47,18 +102,12 @@ export class AppPersonnageAleatoire extends FormApplication {
|
||||
constructor(actor) {
|
||||
super({})
|
||||
this.actor = actor
|
||||
this.current = foundry.utils.duplicate(actor)
|
||||
this.checked = {
|
||||
'name': false,
|
||||
'system.sexe': (this.actor.system.sexe ?? '') == '',
|
||||
'system.age': this.actor.system.age == 0,
|
||||
'system.taille': (this.actor.system.taille ?? '') == '',
|
||||
'system.poids': (this.actor.system.poids ?? '') == '',
|
||||
'system.main': (this.actor.system.main ?? '') == '',
|
||||
'system.heure': (this.actor.system.heure ?? '') == '',
|
||||
'system.cheveux': (this.actor.system.cheveux ?? '') == '',
|
||||
'system.yeux': (this.actor.system.yeux ?? '') == '',
|
||||
}
|
||||
this.current = AppPersonnageAleatoire.getActorValues()
|
||||
this.checked = Object.fromEntries(CONTROLS.map(it => [it.name, [0, '', undefined].includes(it.getter(this.current))]))
|
||||
}
|
||||
|
||||
static getActorValues() {
|
||||
return Object.fromEntries(CONTROLS.map(it => [it.name, it.getter(this.actor)]));
|
||||
}
|
||||
|
||||
async getData(options) {
|
||||
@@ -73,124 +122,84 @@ export class AppPersonnageAleatoire extends FormApplication {
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html)
|
||||
this.html = html
|
||||
this.html.find("button.button-cancel").click(async event => await this.close())
|
||||
this.html.find("button.button-apply").click(async event => await this.onApply())
|
||||
this.html.find("input.current-value").change(async event => await this.onChange(event))
|
||||
this.html.find("div.random-field[data-path='system.heure'] select.current-value").change(async event => await this.onChange(event))
|
||||
this.html.find('a[data-action="sexe-masculin"]').click(async event => await this.onSexe('masculin'))
|
||||
this.html.find('a[data-action="sexe-feminin"]').click(async event => await this.onSexe('féminin'))
|
||||
this.html.find("a.random").click(async event => await this.onRandom(event))
|
||||
this.html.find("a.reset").click(async event => await this.onReset(event))
|
||||
this.html.find("a.randomize-selected").click(async event => await this.onRandomizeSelected())
|
||||
this.html.find("input.check-for-random").click(async event => await this.onCheckForRandom(event))
|
||||
|
||||
this.html.find("div.random-field[data-field-name='heure'] select.current-value").change(async event => await this.onChange(event))
|
||||
this.html.find('a[data-action="sexe-masculin"]').click(async event => await this.onSexe('masculin'))
|
||||
this.html.find('a[data-action="sexe-feminin"]').click(async event => await this.onSexe('féminin'))
|
||||
|
||||
this.html.find("button.button-cancel").click(async event => await this.close())
|
||||
this.html.find("button.button-apply").click(async event => await this.onApply())
|
||||
}
|
||||
|
||||
async _updateObject(event, formData) { }
|
||||
|
||||
async onApply() {
|
||||
const updates = Object.fromEntries(
|
||||
PATHS.filter(path => game.user.isGM || path != 'name')
|
||||
.map(path => [path, this.current[path]])
|
||||
CONTROLS.filter(control => game.user.isGM || control.name != 'name')
|
||||
.map(control => [control.path, control.getter(this.current)])
|
||||
)
|
||||
await this.actor.update(updates)
|
||||
await this.close()
|
||||
}
|
||||
|
||||
getPath(selector) {
|
||||
getName(selector) {
|
||||
const fields = this.html.find(selector).parents("div.random-field:first")
|
||||
return fields[0].attributes['data-path'].value
|
||||
return fields[0].attributes['data-field-name'].value
|
||||
}
|
||||
|
||||
getControl(name) {
|
||||
return CONTROLS.find(it => it.name == name) ?? CONTROL_UNKNOWN
|
||||
}
|
||||
|
||||
async onSexe(sexe) {
|
||||
this.current['system.sexe'] = sexe
|
||||
this.current['sexe'] = sexe
|
||||
this.render()
|
||||
}
|
||||
|
||||
async onChange(event) {
|
||||
const path = this.getPath(event.currentTarget)
|
||||
this.current[path] = event.currentTarget.value
|
||||
const name = this.getName(event.currentTarget)
|
||||
const control = this.getControl(name)
|
||||
this.current[control.name] = event.currentTarget.value
|
||||
this.render()
|
||||
}
|
||||
|
||||
|
||||
async onRandom(event) {
|
||||
const path = this.getPath(event.currentTarget)
|
||||
await this.setRandom(path);
|
||||
const name = this.getName(event.currentTarget)
|
||||
const control = this.getControl(name)
|
||||
await this.randomControl(control)
|
||||
this.render()
|
||||
}
|
||||
|
||||
async onReset(event) {
|
||||
const path = this.getPath(event.currentTarget)
|
||||
this.current[path] = this.actor[path]
|
||||
const name = this.getName(event.currentTarget)
|
||||
const control = this.getControl(name)
|
||||
this.current[control.name] = control.getter(this.actor)
|
||||
await this.render()
|
||||
}
|
||||
|
||||
async onCheckForRandom(event) {
|
||||
const path = this.getPath(event.currentTarget)
|
||||
this.checked[path] = event.currentTarget.checked
|
||||
const name = this.getName(event.currentTarget)
|
||||
this.checked[name] = event.currentTarget.checked
|
||||
this.render()
|
||||
}
|
||||
|
||||
async onRandomizeSelected() {
|
||||
const paths = this.html.find("input.check-for-random:checked")
|
||||
const controls = this.html.find("input.check-for-random:checked")
|
||||
.parents("div.random-field")
|
||||
.toArray()
|
||||
.map(it => it.attributes['data-path'].value)
|
||||
await Promise.all(paths.map(path => this.setRandom(path)))
|
||||
.map(it => this.getControl(it.attributes['data-field-name'].value))
|
||||
await Promise.all(controls.map(it => this.randomControl(it)))
|
||||
this.render()
|
||||
}
|
||||
|
||||
async setRandom(path) {
|
||||
this.current[path] = await this.random(path);
|
||||
async randomControl(control) {
|
||||
this.current[control.name] = await control.random(this.current)
|
||||
}
|
||||
|
||||
async random(path) {
|
||||
switch (path) {
|
||||
case 'name':
|
||||
return await RdDNameGen.generate()
|
||||
case 'system.sexe':
|
||||
case 'system.main':
|
||||
case 'system.cheveux':
|
||||
case 'system.yeux':
|
||||
return await this.randomFromMap(RANDOM_VALUES[path])
|
||||
case 'system.poids':
|
||||
return await this.randomPoids()
|
||||
case 'system.taille':
|
||||
return await this.randomTaille()
|
||||
case 'system.age':
|
||||
return await RdDDice.rollTotal('(2d4kl)*10 + 1d7xo + 2d20kl')
|
||||
case 'system.heure':
|
||||
return RdDTimestamp.defHeure(await RdDDice.rollHeure({ rollMode: "selfroll", showDice: SHOW_DICE })).key
|
||||
}
|
||||
return 'unknown'
|
||||
}
|
||||
|
||||
async randomFromMap(valuesMap) {
|
||||
const max = Object.values(valuesMap).reduce(Misc.sum(), 0)
|
||||
const total = await RdDDice.rollTotal(`1d${max}`)
|
||||
let sum = 0
|
||||
for (let entry of Object.entries(valuesMap)) {
|
||||
sum = sum + entry[1]
|
||||
if (sum >= total) {
|
||||
return entry[0]
|
||||
}
|
||||
}
|
||||
return Object.keys(valuesMap)[0]
|
||||
}
|
||||
|
||||
async randomPoids() {
|
||||
const caracTaille = RdDCarac.getCaracDerivee(this.current.system.carac.taille.value)
|
||||
const range = caracTaille.poidsMax - caracTaille.poidsMin + 1
|
||||
const total = await RdDDice.rollTotal(`1d${range} + ${caracTaille.poidsMin}`)
|
||||
return total + ' kg'
|
||||
}
|
||||
|
||||
async randomTaille() {
|
||||
const caracTaille = RdDCarac.getCaracDerivee(this.current.system.carac.taille.value)
|
||||
const base = this.current.system.carac.taille.value * 2 + 60 + caracTaille.poidsMin
|
||||
const variation = Math.floor((caracTaille.poidsMax - caracTaille.poidsMin + base / 5) / 2)
|
||||
const total = await RdDDice.rollTotal(`2d${variation} + ${base}`)
|
||||
const cm = total % 100
|
||||
const dm = cm < 10 ? '0' : ''
|
||||
const m = (total - cm) / 100
|
||||
return `${m}m${dm}${cm}`
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ export class RdDTextEditor {
|
||||
$(html).on("click", '.roll-text', async event => await RdDTextEditor.rollText(event))
|
||||
}
|
||||
|
||||
static async enrichHTML(text, object, options = {showlink:true}) {
|
||||
static async enrichHTML(text, object, options = { showlink: true }) {
|
||||
const context = {
|
||||
text,
|
||||
object,
|
||||
@@ -70,9 +70,7 @@ export class RdDTextEditor {
|
||||
options: { showLink: false }
|
||||
},
|
||||
param)
|
||||
ChatMessage.create({
|
||||
content: text
|
||||
})
|
||||
await ChatMessage.create({ content: text })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,20 +116,20 @@ export class ChatUtility {
|
||||
return messageData
|
||||
}
|
||||
|
||||
static tellToUser(message) {
|
||||
ChatMessage.create({ content: message, user: game.user.id, whisper: [game.user.id] });
|
||||
static async tellToUser(message) {
|
||||
await ChatMessage.create({ content: message, user: game.user.id, whisper: [game.user.id] });
|
||||
}
|
||||
|
||||
static tellToGM(message) {
|
||||
ChatMessage.create({
|
||||
static async tellToGM(message) {
|
||||
await ChatMessage.create({
|
||||
user: game.user.id,
|
||||
content: message,
|
||||
whisper: ChatUtility.getGMs()
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
static tellToUserAndGM(message) {
|
||||
ChatMessage.create({
|
||||
static async tellToUserAndGM(message) {
|
||||
await ChatMessage.create({
|
||||
user: game.user.id,
|
||||
content: message,
|
||||
whisper: ChatUtility.getUserAndGMs()
|
||||
|
||||
@@ -71,28 +71,32 @@ export class RdDCoeur {
|
||||
}
|
||||
|
||||
static async applyCoeurChateauDormant(actor, message) {
|
||||
const newSuivants = foundry.utils.duplicate(actor.system.subacteurs.suivants)
|
||||
let count = 0
|
||||
newSuivants.forEach(async link => {
|
||||
const suivant = game.actors.get(link.id)
|
||||
const prochainCoeur = link.prochainCoeur ?? 0;
|
||||
const coeurCourant = link.coeur ?? 0;
|
||||
const diff = prochainCoeur - coeurCourant
|
||||
if (diff < 0) {
|
||||
await actor.moralIncDec(-4);
|
||||
link.coeur = Math.max(0, coeurCourant - 1)
|
||||
link.prochainCoeur = link.coeur
|
||||
message.content += `<br>Votre cœur brisé pour ${suivant.name} vous fait perdre 4 points de moral, il vous reste ${link.coeur} points de Cœur.`
|
||||
count++
|
||||
}
|
||||
else if (diff > 0) {
|
||||
link.coeur = Math.min(prochainCoeur, 4)
|
||||
message.content += `<br>Votre cœur bat fort, vous avez maintenant ${link.coeur} points de Cœur pour ${suivant.name}.`
|
||||
link.prochainCoeur = link.coeur
|
||||
count++
|
||||
}
|
||||
let ajustMoral = 0
|
||||
const newSuivants = actor.system.subacteurs.suivants.filter(link => game.actors.get(link.id) != undefined)
|
||||
.map(link => {
|
||||
const suivant = game.actors.get(link.id)
|
||||
const prochainCoeur = link.prochainCoeur ?? 0
|
||||
const coeurCourant = link.coeur ?? 0
|
||||
const diff = prochainCoeur - coeurCourant
|
||||
if (diff < 0) {
|
||||
ajustMoral -= 4
|
||||
link.coeur = Math.max(0, coeurCourant - 1)
|
||||
link.prochainCoeur = link.coeur
|
||||
message.content += `<br>Votre cœur brisé pour ${suivant.name} vous fait perdre 4 points de moral, il vous reste ${link.coeur} points de Cœur.`
|
||||
count++
|
||||
}
|
||||
if (diff > 0) {
|
||||
link.coeur = Math.min(prochainCoeur, 4)
|
||||
message.content += `<br>Votre cœur bat fort, vous avez maintenant ${link.coeur} points de Cœur pour ${suivant.name}.`
|
||||
link.prochainCoeur = link.coeur
|
||||
count++
|
||||
}
|
||||
return foundry.utils.duplicate(link)
|
||||
})
|
||||
if (ajustMoral != 0) {
|
||||
await actor.moralIncDec(ajustMoral, 'Coeur')
|
||||
}
|
||||
)
|
||||
if (count > 0) {
|
||||
await actor.update({ 'system.subacteurs.suivants': newSuivants });
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { TMRUtility } from "./tmr-utility.js";
|
||||
export class DialogCreateSigneDraconique extends Dialog {
|
||||
|
||||
static async createSigneForActors() {
|
||||
const signe = await RdDItemSigneDraconique.randomSigneDraconique({ephemere: true});
|
||||
const signe = await RdDItemSigneDraconique.randomSigneDraconique({ ephemere: true });
|
||||
let dialogData = {
|
||||
signe: signe,
|
||||
tmrs: TMRUtility.buildSelectionTypesTMR(signe.system.typesTMR),
|
||||
@@ -36,25 +36,25 @@ export class DialogCreateSigneDraconique extends Dialog {
|
||||
super(conf, options);
|
||||
this.dialogData = dialogData;
|
||||
}
|
||||
|
||||
|
||||
async _onCreerSigneActeurs() {
|
||||
await this.html.find("[name='signe.system.ephemere']").change();
|
||||
await this.html.find(".signe-xp-sort").change();
|
||||
this.validerSigne();
|
||||
this.dialogData.actors.filter(it => it.selected)
|
||||
.map(it => game.actors.get(it.id))
|
||||
.forEach(actor => this._createSigneForActor(actor, this.dialogData.signe));
|
||||
await this.html.find("[name='signe.system.ephemere']").change()
|
||||
await this.html.find(".signe-xp-sort").change()
|
||||
this.validerSigne()
|
||||
await Promise.all(this.dialogData.actors.filter(it => it.selected)
|
||||
.map(it => game.actors.get(it.id))
|
||||
.map(async actor => await this._createSigneForActor(actor, this.dialogData.signe)))
|
||||
}
|
||||
|
||||
|
||||
async _createSigneForActor(actor, signe) {
|
||||
actor.createEmbeddedDocuments("Item", [signe]);
|
||||
ChatMessage.create({
|
||||
await actor.createEmbeddedDocuments("Item", [signe]);
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(actor),
|
||||
content: await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/chat-signe-draconique-actor.hbs", {
|
||||
signe: signe,
|
||||
alias: actor.getAlias()
|
||||
})
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
validerSigne() {
|
||||
@@ -67,7 +67,7 @@ export class DialogCreateSigneDraconique extends Dialog {
|
||||
this.dialogData.signe.system.duree = this.html.find("[name='signe.system.duree']").val();
|
||||
this.dialogData.signe.system.typesTMR = TMRUtility.buildListTypesTMRSelection(this.dialogData.tmrs);
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
@@ -81,7 +81,7 @@ export class DialogCreateSigneDraconique extends Dialog {
|
||||
}
|
||||
|
||||
async setSigneAleatoire() {
|
||||
const newSigne = await RdDItemSigneDraconique.randomSigneDraconique({ephemere: true});
|
||||
const newSigne = await RdDItemSigneDraconique.randomSigneDraconique({ ephemere: true });
|
||||
|
||||
this.html.find("[name='signe.name']").val(newSigne.name);
|
||||
this.html.find("[name='signe.system.valeur.norm']").val(newSigne.system.valeur.norm);
|
||||
@@ -92,7 +92,7 @@ export class DialogCreateSigneDraconique extends Dialog {
|
||||
this.html.find("[name='signe.system.ephemere']").prop("checked", newSigne.system.ephemere);
|
||||
this.dialogData.tmrs = TMRUtility.buildSelectionTypesTMR(newSigne.system.typesTMR);
|
||||
this.dialogData.tmrs.forEach(t => {
|
||||
this.html.find(`[data-tmr-name='${t.name}']`).prop( "checked", t.selected);
|
||||
this.html.find(`[data-tmr-name='${t.name}']`).prop("checked", t.selected);
|
||||
})
|
||||
this.setEphemere(newSigne.system.ephemere);
|
||||
}
|
||||
@@ -113,7 +113,7 @@ export class DialogCreateSigneDraconique extends Dialog {
|
||||
onSelectTmr(event) {
|
||||
const tmrName = this.html.find(event.currentTarget)?.data("tmr-name");
|
||||
const onTmr = this.dialogData.tmrs.find(it => it.name == tmrName);
|
||||
if (onTmr){
|
||||
if (onTmr) {
|
||||
onTmr.selected = event.currentTarget.checked;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ export class RdDItemCompetence extends RdDItem {
|
||||
archetypeWarning: newNiv > this.system.niveau_archetype
|
||||
}
|
||||
if (display) {
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this.actor),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-competence-xp.hbs`, xpData)
|
||||
})
|
||||
|
||||
@@ -153,10 +153,10 @@ export class RdDItemSort extends RdDItem {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static incrementBonusCase(actor, sort, coord) {
|
||||
static async incrementBonusCase(actor, sort, coord) {
|
||||
let bonuscase = RdDItemSort.calculBonuscase(sort, coord)
|
||||
|
||||
actor.updateEmbeddedDocuments('Item', [{ _id: sort._id, 'system.bonuscase': bonuscase }]);
|
||||
await actor.updateEmbeddedDocuments('Item', [{ _id: sort._id, 'system.bonuscase': bonuscase }]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -627,14 +627,14 @@ export class RdDItem extends Item {
|
||||
system: { description: this.system.description },
|
||||
properties: this.getProprietes(),
|
||||
}
|
||||
renderTemplate(this.getChatItemTemplate(), chatData).then(html => {
|
||||
renderTemplate(this.getChatItemTemplate(), chatData).then(async html => {
|
||||
let chatOptions = RdDUtility.chatDataSetup(html, modeOverride);
|
||||
ChatMessage.create(chatOptions)
|
||||
});
|
||||
await ChatMessage.create(chatOptions)
|
||||
})
|
||||
}
|
||||
|
||||
getChatItemTemplate() {
|
||||
return 'systems/foundryvtt-reve-de-dragon/templates/post-item.hbs';
|
||||
return 'systems/foundryvtt-reve-de-dragon/templates/post-item.hbs'
|
||||
}
|
||||
|
||||
static propertyIfDefined(name, val, condition = true) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { RdDInitiative } from "../initiative.mjs";
|
||||
import { MappingCreatureArme } from "./mapping-creature-arme.mjs";
|
||||
import { Misc } from "../misc.js";
|
||||
|
||||
const nomCategorieParade = {
|
||||
const categorie_parade = {
|
||||
"sans-armes": "Sans arme",
|
||||
"armes-naturelles": "Armes naturelles",
|
||||
"hast": "Armes d'hast",
|
||||
@@ -18,6 +18,7 @@ const nomCategorieParade = {
|
||||
"epees-lourdes": "Epées lourdes",
|
||||
"haches": "Haches",
|
||||
"lances": "Lances",
|
||||
"masses": "Masses",
|
||||
}
|
||||
export const ATTAQUE_TYPE = {
|
||||
UNE_MAIN: '(1 main)',
|
||||
@@ -122,7 +123,7 @@ export class RdDItemArme extends RdDItem {
|
||||
/* -------------------------------------------- */
|
||||
static getNomCategorieParade(arme) {
|
||||
const categorie = arme?.system ? RdDItemArme.getCategorieParade(arme) : arme;
|
||||
return nomCategorieParade[categorie];
|
||||
return categorie_parade[categorie];
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
@@ -21,7 +21,7 @@ export class RdDItemArmure extends RdDItem {
|
||||
if (deterioration >= 10) {
|
||||
deterioration -= 10;
|
||||
protection = this.calculProtectionDeterioree();
|
||||
ChatMessage.create({ content: `Votre armure ${this.name} s'est détériorée, elle protège maintenant de ${protection}` });
|
||||
await ChatMessage.create({ content: `Votre armure ${this.name} s'est détériorée, elle protège maintenant de ${protection}` });
|
||||
}
|
||||
await this.update({
|
||||
'system.deterioration': deterioration,
|
||||
|
||||
@@ -54,7 +54,7 @@ export class RdDItemBlessure extends RdDItem {
|
||||
}
|
||||
await this.createBlessure(actor, gravite)
|
||||
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
//TODO: hbs
|
||||
content: `Blessure ${definition.label} appliquée à ${actor.name}<br>Perte d'endurance : ${lostEndurance} (${definition.endurance})<br>Perte de Vie : ${definition.vie}`,
|
||||
whisper: ChatUtility.getOwners(actor)
|
||||
|
||||
@@ -22,7 +22,7 @@ export class RdDItemMaladie extends RdDItem {
|
||||
const souffrance = mal.system.identifie
|
||||
? `de ${mal.name}`
|
||||
: `d'un mal inconnu`
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(mal.actor),
|
||||
content: `${mal.actor.name} souffre ${souffrance} (${Misc.typeName('Item', mal.type)}): vérifiez que les effets ne se sont pas aggravés !`
|
||||
})
|
||||
|
||||
@@ -354,7 +354,7 @@ class _10_4_6_ServicesEnCommerces extends Migration {
|
||||
}
|
||||
async transformInventaireCommerce(service) {
|
||||
const serviceItems = (service.system.items ?? []);
|
||||
const commerceItems = await Promise.all(serviceItems.map(async (it) => { return await this.transformToItemBoutique(it); }));
|
||||
const commerceItems = await Promise.all(serviceItems.map((it) => this.transformToItemBoutique(it)))
|
||||
return commerceItems.concat(Monnaie.monnaiesStandard());
|
||||
}
|
||||
|
||||
@@ -434,7 +434,7 @@ class _10_7_0_MigrationBlessures extends Migration {
|
||||
'system.blessures.graves.liste': [],
|
||||
'system.blessures.critiques.liste': []
|
||||
})
|
||||
}));
|
||||
}))
|
||||
}
|
||||
creerBlessure(gravite, graviteTexte, blessure, timestamp) {
|
||||
const dateBlessure = timestamp.addJours(-blessure.jours);
|
||||
@@ -786,6 +786,6 @@ export class Migrations {
|
||||
}
|
||||
|
||||
compareVersions(a, b) {
|
||||
return isNewerVersion(a.version, b.version) ? 1 : isNewerVersion(b.version, a.version) ? -1 : 0;
|
||||
return foundry.utils.isNewerVersion(a.version, b.version) ? 1 : foundry.utils.isNewerVersion(b.version, a.version) ? -1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,7 @@ export class Misc {
|
||||
return text.charAt(0).toLowerCase() + text.slice(1);
|
||||
}
|
||||
|
||||
static stripHtml(html)
|
||||
{
|
||||
static stripHtml(html) {
|
||||
const tmp = document.createElement("DIV")
|
||||
tmp.innerHTML = html
|
||||
return tmp.textContent || tmp.innerText || ""
|
||||
@@ -329,4 +328,19 @@ export class Misc {
|
||||
'-o-transform': rotation
|
||||
};
|
||||
}
|
||||
|
||||
static async random(count) {
|
||||
const roll = new Roll(`1d${count}`)
|
||||
await roll.evaluate()
|
||||
return roll.total
|
||||
}
|
||||
|
||||
static shuffled(source) {
|
||||
const result = source.slice(0)
|
||||
for (let i = result.length - 1; i > 0; i--) {
|
||||
const j = Math.floor(Math.random() * (i + 1));
|
||||
[result[i], result[j]] = [result[j], result[i]];
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,8 @@ import { SANS_COMPETENCE } from "../item/base-items.js"
|
||||
import { Misc } from "../misc.js"
|
||||
import { CARACS } from "../rdd-carac.js"
|
||||
import { RdDUtility } from "../rdd-utility.js"
|
||||
import { DIFF } from "../roll/roll-constants.mjs"
|
||||
import { DIFF, ROLL_TYPE_COMP } from "../roll/roll-constants.mjs"
|
||||
import RollDialog from "../roll/roll-dialog.mjs"
|
||||
import { PART_COMP } from "../roll/roll-part-comp.mjs"
|
||||
|
||||
export const MORAL = {
|
||||
MALHEUREUX: "malheureux",
|
||||
@@ -134,7 +133,7 @@ export class Apprecier {
|
||||
const competence = (this.appreciation.jetComp && this.appreciation.competence) ? this.appreciation.competence : ""
|
||||
const rollData = {
|
||||
ids: { actorId: this.actor.id },
|
||||
type: { allowed: [PART_COMP], current: PART_COMP, appreciation: true },
|
||||
type: { allowed: [ROLL_TYPE_COMP], current: ROLL_TYPE_COMP, appreciation: true },
|
||||
selected: {
|
||||
carac: { key: this.appreciation.carac, forced: true },
|
||||
comp: { key: competence, forced: true },
|
||||
@@ -168,7 +167,7 @@ export class Apprecier {
|
||||
|
||||
async rollMoral(moral = undefined) {
|
||||
if (this.raisons.length > 0) {
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this.actor),
|
||||
content: 'Pas de jet de moral:' + Misc.concat(this.raisons.map(r => `<br> - ${r}`))
|
||||
})
|
||||
@@ -176,7 +175,6 @@ export class Apprecier {
|
||||
}
|
||||
|
||||
moral = moral ?? this.appreciation.moral
|
||||
// TODO: jet de moral
|
||||
await this.actor.jetDeMoral(moral, this.appreciation.bonmoment)
|
||||
}
|
||||
}
|
||||
@@ -3,38 +3,38 @@ import { Misc } from "./misc.js";
|
||||
|
||||
const TABLE_CARACTERISTIQUES_DERIVEES = {
|
||||
// xp: coût pour passer du niveau inférieur à ce niveau
|
||||
1: { xp: 3, niveau: -5, poids: "moins de 1kg", poidsMin: 0, poidsMax: 1, plusdom: -5, sconst: 0.5, sust: 0.1 },
|
||||
2: { xp: 3, niveau: -4, poids: "1-5", poidsMin: 1, poidsMax: 5, plusdom: -4, sconst: 0.5, sust: 0.3 },
|
||||
3: { xp: 4, niveau: -3, poids: "6-10", poidsMin: 6, poidsMax: 10, plusdom: -3, sconst: 1, sust: 0.5, beaute: 'hideux' },
|
||||
4: { xp: 4, niveau: -2, poids: "11-20", poidsMin: 11, poidsMax: 20, plusdom: -3, sconst: 1, sust: 1, beaute: 'repoussant' },
|
||||
5: { xp: 5, niveau: -1, poids: "21-30", poidsMin: 21, poidsMax: 30, plusdom: -2, sconst: 1, sust: 1, beaute: 'franchement très laid' },
|
||||
6: { xp: 5, niveau: 0, poids: "31-40", poidsMin: 31, poidsMax: 40, plusdom: -1, sconst: 2, sust: 2, beaute: 'laid' },
|
||||
7: { xp: 6, niveau: 0, poids: "41-50", poidsMin: 41, poidsMax: 50, plusdom: -1, sconst: 2, sust: 2, beaute: 'très désavantagé' },
|
||||
8: { xp: 6, niveau: 0, poids: "51-60", poidsMin: 51, poidsMax: 60, plusdom: 0, sconst: 2, sust: 2, beaute: 'désavantagé' },
|
||||
9: { xp: 7, niveau: 0, poids: "61-65", poidsMin: 61, poidsMax: 65, plusdom: 0, sconst: 3, sust: 2, beaute: 'pas terrible' },
|
||||
10: { xp: 7, niveau: 0, poids: "66-70", poidsMin: 66, poidsMax: 70, plusdom: 0, sconst: 3, sust: 3, beaute: 'commun' },
|
||||
11: { xp: 8, niveau: 1, poids: "71-75", poidsMin: 71, poidsMax: 75, plusdom: 0, sconst: 3, sust: 3, beaute: 'pas mal' },
|
||||
12: { xp: 8, niveau: 1, poids: "76-80", poidsMin: 76, poidsMax: 80, plusdom: +1, sconst: 4, sust: 3, beaute: 'avantagé' },
|
||||
13: { xp: 9, niveau: 2, poids: "81-90", poidsMin: 81, poidsMax: 90, plusdom: +1, sconst: 4, sust: 3, beaute: 'mignon' },
|
||||
14: { xp: 9, niveau: 2, poids: "91-100", poidsMin: 91, poidsMax: 100, plusdom: +2, sconst: 4, sust: 4, beaute: 'beau' },
|
||||
15: { xp: 10, niveau: 3, poids: "101-110", poidsMin: 101, poidsMax: 110, plusdom: +2, sconst: 5, sust: 4, beaute: 'très beau' },
|
||||
16: { xp: 20, niveau: 3, poids: "111-120", poidsMin: 111, poidsMax: 120, plusdom: +3, sconst: 5, sust: 4, beaute: 'éblouissant' },
|
||||
17: { xp: 30, niveau: 4, poids: "121-131", poidsMin: 121, poidsMax: 131, plusdom: +3, sconst: 5, sust: 5 },
|
||||
18: { xp: 40, niveau: 4, poids: "131-141", poidsMin: 131, poidsMax: 141, plusdom: +4, sconst: 6, sust: 5 },
|
||||
19: { xp: 50, niveau: 5, poids: "141-150", poidsMin: 141, poidsMax: 150, plusdom: +4, sconst: 6, sust: 5 },
|
||||
20: { xp: 60, niveau: 5, poids: "151-160", poidsMin: 151, poidsMax: 160, plusdom: +4, sconst: 6, sust: 6 },
|
||||
21: { xp: 70, niveau: 6, poids: "161-180", poidsMin: 161, poidsMax: 180, plusdom: +5, sconst: 7, sust: 6 },
|
||||
22: { xp: 80, niveau: 6, poids: "181-200", poidsMin: 181, poidsMax: 200, plusdom: +5, sconst: 7, sust: 7 },
|
||||
23: { xp: 90, niveau: 7, poids: "201-300", poidsMin: 201, poidsMax: 300, plusdom: +6, sconst: 7, sust: 8 },
|
||||
24: { xp: 100, niveau: 7, poids: "301-400", poidsMin: 301, poidsMax: 400, plusdom: +6, sconst: 8, sust: 9 },
|
||||
25: { xp: 110, niveau: 8, poids: "401-500", poidsMin: 401, poidsMax: 500, plusdom: +7, sconst: 8, sust: 10 },
|
||||
26: { xp: 120, niveau: 8, poids: "501-600", poidsMin: 501, poidsMax: 600, plusdom: +7, sconst: 8, sust: 11 },
|
||||
27: { xp: 130, niveau: 9, poids: "601-700", poidsMin: 601, poidsMax: 700, plusdom: +8, sconst: 9, sust: 12 },
|
||||
28: { xp: 140, niveau: 9, poids: "701-800", poidsMin: 701, poidsMax: 800, plusdom: +8, sconst: 9, sust: 13 },
|
||||
29: { xp: 150, niveau: 10, poids: "801-900", poidsMin: 801, poidsMax: 900, plusdom: +9, sconst: 9, sust: 14 },
|
||||
30: { xp: 160, niveau: 10, poids: "901-1000", poidsMin: 901, poidsMax: 1000, plusdom: +9, sconst: 10, sust: 15 },
|
||||
31: { xp: 170, niveau: 11, poids: "1001-1500", poidsMin: 1001, poidsMax: 1500, plusdom: +10, sconst: 10, sust: 16 },
|
||||
32: { xp: 180, niveau: 11, poids: "1501-2000", poidsMin: 1501, poidsMax: 2000, plusdom: +11, sconst: 10, sust: 17 }
|
||||
1: { xp: 3, niveau: -5, taille: 40, poids: "moins de 1kg", poidsMin: 0, poidsMax: 1, plusdom: -5, sconst: 0.5, sust: 0.1 },
|
||||
2: { xp: 3, niveau: -4, taille: 70, poids: "1-5", poidsMin: 1, poidsMax: 5, plusdom: -4, sconst: 0.5, sust: 0.3 },
|
||||
3: { xp: 4, niveau: -3, taille: 100, poids: "6-10", poidsMin: 6, poidsMax: 10, plusdom: -3, sconst: 1, sust: 0.5, beaute: 'hideux' },
|
||||
4: { xp: 4, niveau: -2, taille: 120, poids: "11-20", poidsMin: 11, poidsMax: 20, plusdom: -3, sconst: 1, sust: 1, beaute: 'repoussant' },
|
||||
5: { xp: 5, niveau: -1, taille: 135, poids: "21-30", poidsMin: 21, poidsMax: 30, plusdom: -2, sconst: 1, sust: 1, beaute: 'franchement très laid' },
|
||||
6: { xp: 5, niveau: 0, taille: 145, poids: "31-40", poidsMin: 31, poidsMax: 40, plusdom: -1, sconst: 2, sust: 2, beaute: 'laid' },
|
||||
7: { xp: 6, niveau: 0, taille: 150, poids: "41-50", poidsMin: 41, poidsMax: 50, plusdom: -1, sconst: 2, sust: 2, beaute: 'très désavantagé' },
|
||||
8: { xp: 6, niveau: 0, taille: 155, poids: "51-60", poidsMin: 51, poidsMax: 60, plusdom: 0, sconst: 2, sust: 2, beaute: 'désavantagé' },
|
||||
9: { xp: 7, niveau: 0, taille: 160, poids: "61-65", poidsMin: 61, poidsMax: 65, plusdom: 0, sconst: 3, sust: 2, beaute: 'pas terrible' },
|
||||
10: { xp: 7, niveau: 0, taille: 170, poids: "66-70", poidsMin: 66, poidsMax: 70, plusdom: 0, sconst: 3, sust: 3, beaute: 'commun' },
|
||||
11: { xp: 8, niveau: 1, taille: 175, poids: "71-75", poidsMin: 71, poidsMax: 75, plusdom: 0, sconst: 3, sust: 3, beaute: 'pas mal' },
|
||||
12: { xp: 8, niveau: 1, taille: 180, poids: "76-80", poidsMin: 76, poidsMax: 80, plusdom: +1, sconst: 4, sust: 3, beaute: 'avantagé' },
|
||||
13: { xp: 9, niveau: 2, taille: 185, poids: "81-90", poidsMin: 81, poidsMax: 90, plusdom: +1, sconst: 4, sust: 3, beaute: 'mignon' },
|
||||
14: { xp: 9, niveau: 2, taille: 190, poids: "91-100", poidsMin: 91, poidsMax: 100, plusdom: +2, sconst: 4, sust: 4, beaute: 'beau' },
|
||||
15: { xp: 10, niveau: 3, taille: 200, poids: "101-110", poidsMin: 101, poidsMax: 110, plusdom: +2, sconst: 5, sust: 4, beaute: 'très beau' },
|
||||
16: { xp: 20, niveau: 3, taille: 210, poids: "111-120", poidsMin: 111, poidsMax: 120, plusdom: +3, sconst: 5, sust: 4, beaute: 'éblouissant' },
|
||||
17: { xp: 30, niveau: 4, taille: 220, poids: "121-131", poidsMin: 121, poidsMax: 131, plusdom: +3, sconst: 5, sust: 5 },
|
||||
18: { xp: 40, niveau: 4, taille: 230, poids: "131-141", poidsMin: 131, poidsMax: 141, plusdom: +4, sconst: 6, sust: 5 },
|
||||
19: { xp: 50, niveau: 5, taille: 240, poids: "141-150", poidsMin: 141, poidsMax: 150, plusdom: +4, sconst: 6, sust: 5 },
|
||||
20: { xp: 60, niveau: 5, taille: 250, poids: "151-160", poidsMin: 151, poidsMax: 160, plusdom: +4, sconst: 6, sust: 6 },
|
||||
21: { xp: 70, niveau: 6, taille: 260, poids: "161-180", poidsMin: 161, poidsMax: 180, plusdom: +5, sconst: 7, sust: 6 },
|
||||
22: { xp: 80, niveau: 6, taille: 270, poids: "181-200", poidsMin: 181, poidsMax: 200, plusdom: +5, sconst: 7, sust: 7 },
|
||||
23: { xp: 90, niveau: 7, taille: 280, poids: "201-300", poidsMin: 201, poidsMax: 300, plusdom: +6, sconst: 7, sust: 8 },
|
||||
24: { xp: 100, niveau: 7, taille: 290, poids: "301-400", poidsMin: 301, poidsMax: 400, plusdom: +6, sconst: 8, sust: 9 },
|
||||
25: { xp: 110, niveau: 8, taille: 300, poids: "401-500", poidsMin: 401, poidsMax: 500, plusdom: +7, sconst: 8, sust: 10 },
|
||||
26: { xp: 120, niveau: 8, taille: 310, poids: "501-600", poidsMin: 501, poidsMax: 600, plusdom: +7, sconst: 8, sust: 11 },
|
||||
27: { xp: 130, niveau: 9, taille: 320, poids: "601-700", poidsMin: 601, poidsMax: 700, plusdom: +8, sconst: 9, sust: 12 },
|
||||
28: { xp: 140, niveau: 9, taille: 330, poids: "701-800", poidsMin: 701, poidsMax: 800, plusdom: +8, sconst: 9, sust: 13 },
|
||||
29: { xp: 150, niveau: 10, taille: 340, poids: "801-900", poidsMin: 801, poidsMax: 900, plusdom: +9, sconst: 9, sust: 14 },
|
||||
30: { xp: 160, niveau: 10, taille: 350, poids: "901-1000", poidsMin: 901, poidsMax: 1000, plusdom: +9, sconst: 10, sust: 15 },
|
||||
31: { xp: 170, niveau: 11, taille: 360, poids: "1001-1500", poidsMin: 1001, poidsMax: 1500, plusdom: +10, sconst: 10, sust: 16 },
|
||||
32: { xp: 180, niveau: 11, taille: 370, poids: "1501-2000", poidsMin: 1501, poidsMax: 2000, plusdom: +11, sconst: 10, sust: 17 },
|
||||
};
|
||||
|
||||
export const CARACS = {
|
||||
|
||||
@@ -170,7 +170,7 @@ export class RdDCombatManager extends Combat {
|
||||
}
|
||||
|
||||
static getFirstInitRollFormula(actor) {
|
||||
const actions = actor.listActions({ isEquipe: true })
|
||||
const actions = actor.listActions()
|
||||
if (actions.length > 0) {
|
||||
const action = actions[0]
|
||||
const init = RdDCombatManager.getInitData(actor, action)
|
||||
@@ -199,8 +199,8 @@ export class RdDCombatManager extends Combat {
|
||||
<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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -307,7 +307,7 @@ export class RdDCombatManager extends Combat {
|
||||
const possessions = actor.listActionsPossessions()
|
||||
const actions = possessions.length > 0
|
||||
? possessions
|
||||
: actor.listActions({ isEquipe: true })
|
||||
: actor.listActions()
|
||||
|
||||
return Misc.indexed(actions)
|
||||
}
|
||||
@@ -610,7 +610,7 @@ export class RdDCombat {
|
||||
async proposerAjustementTirLancer(rollData) {
|
||||
if (['tir', 'lancer'].includes(rollData.competence.system.categorie)) {
|
||||
if (this.defender.isEntiteBlurette()) {
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
content: `<strong>La cible est une blurette, l'arme à distance sera perdue dans le blurêve`,
|
||||
whisper: ChatUtility.getGMs()
|
||||
})
|
||||
@@ -625,7 +625,7 @@ export class RdDCombat {
|
||||
},
|
||||
Distance.ajustements(_token, defenderToken, { arme: rollData.arme, main: rollData.competence.system.categorie })
|
||||
)
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-info-distance.hbs', info),
|
||||
whisper: ChatUtility.getGMs()
|
||||
})
|
||||
@@ -644,7 +644,7 @@ export class RdDCombat {
|
||||
opponentId: this.defender.id,
|
||||
opponentTokenId: this.defenderTokenId,
|
||||
},
|
||||
type: { allowed: ['attaque'], current: 'attaque' },
|
||||
type: { allowed: [ROLL_TYPE_ATTAQUE], current: ROLL_TYPE_ATTAQUE },
|
||||
selected: {},
|
||||
passeArme: foundry.utils.randomID(16),
|
||||
}
|
||||
@@ -756,7 +756,7 @@ export class RdDCombat {
|
||||
let rollData = this._prepareAttaque(competence, arme)
|
||||
console.log("RdDCombat.attaque >>>", rollData)
|
||||
if (arme) {
|
||||
this.attacker.verifierForceMin(arme);
|
||||
await this.attacker.verifierForceMin(arme);
|
||||
}
|
||||
await this.proposerAjustementTirLancer(rollData)
|
||||
|
||||
|
||||
@@ -218,9 +218,6 @@ export class RdDCommands {
|
||||
/* -------------------------------------------- */
|
||||
/* Manage chat commands */
|
||||
processChatCommand(commandLine, content = '', msg = {}) {
|
||||
// Setup new message's visibility
|
||||
ChatUtility.applyRollMode(msg)
|
||||
msg.type = 0;
|
||||
|
||||
if (!this.commandsTable) {
|
||||
this._registerCommands()
|
||||
@@ -228,6 +225,9 @@ export class RdDCommands {
|
||||
|
||||
let command = commandLine[0].toLowerCase();
|
||||
if (this._isCommandHandled(command)) {
|
||||
// Setup new message's visibility
|
||||
ChatUtility.applyRollMode(msg)
|
||||
msg.type = 0;
|
||||
let params = commandLine.slice(1);
|
||||
this._processCommand(this.commandsTable, command, params, content, msg)
|
||||
return true
|
||||
@@ -367,7 +367,7 @@ export class RdDCommands {
|
||||
|
||||
const carac = params[0];
|
||||
const competence = length > 1 ? '/' + Misc.join(params.slice(1, length), ' ') : ''
|
||||
ChatMessage.create({ content: `@roll[${carac}${competence}/${diff}]` })
|
||||
await ChatMessage.create({ content: `@roll[${carac}${competence}/${diff}]` })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,7 +466,10 @@ export class RdDCommands {
|
||||
|
||||
async supprimerSignesDraconiquesEphemeres() {
|
||||
if (game.user.isGM) {
|
||||
game.actors.forEach(actor => actor.supprimerSignesDraconiques(it => it.system.ephemere))
|
||||
await Promise.all(
|
||||
game.actors.filter(actor => actor.isHautRevant())
|
||||
.map(actor => actor.supprimerSignesDraconiques(it => it.system.ephemere))
|
||||
)
|
||||
}
|
||||
else {
|
||||
ui.notifications.warn("Seul le MJ est autorisé à utiliser la commande /signe");
|
||||
|
||||
@@ -18,7 +18,7 @@ export class DeTMR extends foundry.dice.terms.Die {
|
||||
|
||||
static diceSoNiceData(system) {
|
||||
return {
|
||||
type: "dt",
|
||||
type: "d8",
|
||||
font: "HeuresDraconiques",
|
||||
fontScale: 0.8,
|
||||
labels: ['1', '2', '3', '4', '5', '6', 'd', '0'],
|
||||
@@ -56,7 +56,7 @@ export class DeDraconique extends foundry.dice.terms.Die {
|
||||
|
||||
static diceSoNiceData(system) {
|
||||
return {
|
||||
type: "dr",
|
||||
type: "d8",
|
||||
font: "HeuresDraconiques",
|
||||
fontScale: 0.8,
|
||||
labels: ['1', '2', '3', '4', '5', '6', 'd', '0'],
|
||||
@@ -96,7 +96,7 @@ export class DeHeure extends foundry.dice.terms.Die {
|
||||
|
||||
static diceSoNiceData(system) {
|
||||
return {
|
||||
type: "dh",
|
||||
type: "d12",
|
||||
font: "HeuresDraconiques",
|
||||
fontScale: 1.2,
|
||||
labels: ['v', 'i', 'f', 'o', 'd', 'e', 'l', 's', 'p', 'a', 'r', 'c'],
|
||||
|
||||
@@ -377,7 +377,17 @@ export class SystemReveDeDragon {
|
||||
/* -------------------------------------------- */
|
||||
game.system.rdd.calendrier = new RdDCalendrier()
|
||||
if (Misc.isFirstConnectedGM()) {
|
||||
new Migrations().migrate()
|
||||
try {
|
||||
new Migrations().migrate()
|
||||
}
|
||||
catch (erreur) {
|
||||
const message = `<p>Erreur lors de la migration du système Rêve de Dragon: ${erreur}</p><p>Plus de détails sont sans doute disponibles dans la console de Foundry/du navigateur.</p><p>Merci de nous signaler cetter erreur qu'on puisse ous aider et réparer le problème.</p>`
|
||||
ui.notifications.error(message)
|
||||
await ChatMessage.create({
|
||||
user: game.user.id,
|
||||
content: message
|
||||
})
|
||||
}
|
||||
this.messageDeBienvenue()
|
||||
import("https://www.uberwald.me/fvtt_appcount/count-class-ready.js").then(moduleCounter => {
|
||||
console.log("ClassCounter loaded", moduleCounter)
|
||||
@@ -399,7 +409,7 @@ export class SystemReveDeDragon {
|
||||
if (!game.user.isGM && game.user.character == undefined) {
|
||||
ui.notifications.info("Attention ! Vous n'êtes connecté à aucun personnage !")
|
||||
ChatMessage.create({
|
||||
content: "<b>ATTENTION</b> Le joueur " + game.user.name + " n'est connecté à aucun personnage !",
|
||||
content: `<b>ATTENTION</b> Le joueur ${game.user.name} n'est connecté à aucun personnage !`,
|
||||
user: game.user.id
|
||||
})
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ export class RdDMeteo {
|
||||
meteo.nuage.description = RdDMeteo.nuage(meteo.nuage.force);
|
||||
meteo.pluie.description = RdDMeteo.pluie(meteo.pluie.force);
|
||||
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-resultat-meteo.hbs', meteo),
|
||||
whisper: ChatUtility.getGMs()
|
||||
});
|
||||
|
||||
@@ -49,7 +49,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
await PixiTMR.init()
|
||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.hbs', tmrData);
|
||||
if (tmrData.mode != 'visu' && !game.user.isGM) {
|
||||
ChatMessage.create({ content: actor.name + " est monté dans les TMR en mode : " + tmrData.mode, whisper: ChatUtility.getGMs() });
|
||||
await ChatMessage.create({ content: actor.name + " est monté dans les TMR en mode : " + tmrData.mode, whisper: ChatUtility.getGMs() });
|
||||
}
|
||||
return new RdDTMRDialog(html, actor, tmrData)
|
||||
}
|
||||
@@ -138,7 +138,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
this.html.find('img.tmr-move').click(event => this.deplacementTMR(this.html.find(event.currentTarget)?.data('move')));
|
||||
|
||||
// Gestion du cout de montée en points de rêve
|
||||
await this.actor.reveActuelIncDec(this.calculCoutMonteeTMR());
|
||||
await this.actor.reveActuelIncDec(await this.calculCoutMonteeTMR());
|
||||
this.cumulFatigue += this.fatigueParCase;
|
||||
|
||||
// Le reste...
|
||||
@@ -305,8 +305,8 @@ export class RdDTMRDialog extends Dialog {
|
||||
await this.$checkQuitterTMR();
|
||||
}
|
||||
|
||||
calculCoutMonteeTMR() {
|
||||
return ((this.tmrdata.isRapide && !EffetsDraconiques.isDeplacementAccelere(this.actor)) ? -2 : -1) - this.actor.countMonteeLaborieuse();
|
||||
async calculCoutMonteeTMR() {
|
||||
return ((this.tmrdata.isRapide && !EffetsDraconiques.isDeplacementAccelere(this.actor)) ? -2 : -1) - (await this.actor.countMonteeLaborieuse())
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -501,7 +501,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
rencData.poesie = { extrait: result.poesie, reference: result.reference };
|
||||
rencData.message = this.$formatMessageRencontre(rencData, result.message);
|
||||
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this.actor),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-rencontre-tmr.hbs`, rencData)
|
||||
});
|
||||
@@ -653,7 +653,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
this.restoreTMRAfterAction()
|
||||
if (myRoll == 7) {
|
||||
ChatUtility.tellToUser(myRoll + ": Rencontre en " + coordTMR);
|
||||
return await game.system.rdd.rencontresTMR.getRencontreAleatoire(tmr, this.actor.isMauvaiseRencontre())
|
||||
return await game.system.rdd.rencontresTMR.getRencontreAleatoire(tmr, await this.actor.isMauvaiseRencontre())
|
||||
} else {
|
||||
ChatUtility.tellToUser(myRoll + ": Pas de rencontre en " + coordTMR);
|
||||
return undefined;
|
||||
@@ -708,7 +708,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
return;
|
||||
}
|
||||
rollData.poesie = await Poetique.getExtrait();
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this.actor),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-maitrise-tmr.hbs`, rollData)
|
||||
});
|
||||
@@ -728,16 +728,16 @@ export class RdDTMRDialog extends Dialog {
|
||||
/* -------------------------------------------- */
|
||||
isCaseHumide(tmr) {
|
||||
if (!(TMRUtility.isCaseHumide(tmr) || this.isCaseHumideAdditionelle(tmr))) {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
if (this.isCaseMaitrisee(tmr.coord)) {
|
||||
ChatMessage.create({
|
||||
content: tmr.label + ": cette case humide est déja maitrisée grâce à votre Tête <strong>Quête des Eaux</strong>",
|
||||
whisper: ChatUtility.getOwners(this.actor)
|
||||
});
|
||||
return false;
|
||||
})
|
||||
return false
|
||||
}
|
||||
return true;
|
||||
return true
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -747,16 +747,16 @@ export class RdDTMRDialog extends Dialog {
|
||||
content: tmr.label + ": Vous êtes sous le coup d'une Impraticabilité des Ponts : ce pont doit être maîtrisé comme une case humide.",
|
||||
whisper: ChatUtility.getOwners(this.actor)
|
||||
});
|
||||
return true;
|
||||
return true
|
||||
}
|
||||
if (this.isCaseInondee(tmr.coord)) {
|
||||
ChatMessage.create({
|
||||
content: tmr.label + ": cette case est inondée, elle doit être maîtrisée comme une case humide.",
|
||||
whisper: ChatUtility.getOwners(this.actor)
|
||||
});
|
||||
return true;
|
||||
return true
|
||||
}
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -825,7 +825,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
rollData.souffle = await this.actor.ajouterSouffle({ chat: false })
|
||||
}
|
||||
rollData.poesie = await Poetique.getExtrait()
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this.actor),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-maitrise-tmr.hbs`, rollData)
|
||||
})
|
||||
@@ -876,7 +876,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
const reserveSecurite = EffetsDraconiques.isReserveEnSecurite(this.actor);
|
||||
const reserveExtensible = this.isReserveExtensible(coord);
|
||||
if (!EffetsDraconiques.isUrgenceDraconique(this.actor) && (reserveSecurite || reserveExtensible)) {
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-demande-declencher-sort.hbs`, {
|
||||
actor: this.actor,
|
||||
sorts: sorts,
|
||||
@@ -892,13 +892,13 @@ export class RdDTMRDialog extends Dialog {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
lancerSortEnReserve(coord, sortId) {
|
||||
async lancerSortEnReserve(coord, sortId) {
|
||||
const sort = this.getSortsReserve(coord)
|
||||
.find(it => it.id == sortId);
|
||||
if (sort) {
|
||||
this.processSortReserve(sort);
|
||||
await this.processSortReserve(sort);
|
||||
} else {
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
content: "Une erreur est survenue : impossible de récupérer le sort en réserve demandé.",
|
||||
whisper: ChatUtility.getOwners(this.actor)
|
||||
});
|
||||
|
||||
@@ -49,7 +49,7 @@ export class RdDTokenHud {
|
||||
|
||||
static async addExtensionHudCombatV2(html, combatant, actor, token) {
|
||||
const isPossession = actor.listActionsPossessions().length > 0;
|
||||
const actionsCombat = isPossession ? [] : actor.listAttaques()
|
||||
const actionsCombat = isPossession ? [] : actor.listActions()
|
||||
const ajustements = combatant?.initiative ?
|
||||
[
|
||||
{ label: 'Initiative +1', action: 'delta', value: 1 },
|
||||
|
||||
@@ -132,9 +132,9 @@ export class RdDUtility {
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-derivee.hbs',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-creature.hbs',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-entitee.hbs',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-total.hbs',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/comp-creature.hbs',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/comp-possession.hbs',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/carac-total.hbs',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/competence.hbs',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.hbs',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/xp-competences.hbs',
|
||||
@@ -173,6 +173,7 @@ export class RdDUtility {
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/liens-vehicules.hbs',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/commerce-inventaire.hbs',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/commerce-inventaire-item.hbs',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/tooltip-bonmoments.hbs',
|
||||
//Items
|
||||
'systems/foundryvtt-reve-de-dragon/templates/scripts/autocomplete-script.hbs',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/scripts/autocomplete.hbs',
|
||||
@@ -300,6 +301,7 @@ export class RdDUtility {
|
||||
Handlebars.registerHelper('grammar-un', str => Grammar.articleIndetermine(str));
|
||||
Handlebars.registerHelper('grammar-accord', (genre, ...args) => Grammar.accord(genre, args));
|
||||
Handlebars.registerHelper('json-stringify', object => JSON.stringify(object))
|
||||
Handlebars.registerHelper('escapeHtml', object => foundry.utils.escapeHTML(object))
|
||||
|
||||
// math
|
||||
Handlebars.registerHelper('math-sum', (...values) => values.slice(0, -1).reduce(Misc.sum(), 0))
|
||||
@@ -750,12 +752,12 @@ export class RdDUtility {
|
||||
actor.tmrApp.positionnerDemiReve(coord);
|
||||
});
|
||||
// Gestion spécifique des sorts en réserve multiples (ie têtes)
|
||||
$(html).on("click", '.declencher-sort-reserve', event => {
|
||||
$(html).on("click", '.declencher-sort-reserve', async event => {
|
||||
let coord = event.currentTarget.attributes['data-tmr-coord'].value;
|
||||
let sortId = event.currentTarget.attributes['data-sort-id'].value;
|
||||
let actorId = event.currentTarget.attributes['data-actor-id'].value;
|
||||
let actor = game.actors.get(actorId);
|
||||
actor.tmrApp.lancerSortEnReserve(coord, sortId);
|
||||
await actor.tmrApp.lancerSortEnReserve(coord, sortId);
|
||||
// TODO: supprimer le message?
|
||||
});
|
||||
|
||||
@@ -844,12 +846,12 @@ export class RdDUtility {
|
||||
return game.user.character;
|
||||
}
|
||||
if (msgPlayer != undefined) {
|
||||
msgPlayer += "<br>vous pouvez sélectionner un seul token lié à un personnage";
|
||||
msgPlayer += "<br>vous pouvez sélectionner un seul token lié à un personnage"
|
||||
msgPlayer += "<br>vous devez être connecté comme joueur avec un personnage sélectionné";
|
||||
ui.notifications.warn(msgPlayer);
|
||||
ChatMessage.create({ content: msgPlayer, whisper: [game.user] });
|
||||
ChatMessage.create({ content: msgPlayer, whisper: [game.user] })
|
||||
}
|
||||
return undefined;
|
||||
return undefined
|
||||
}
|
||||
|
||||
static doWithSelectedActor(onSelected = () => { }, filter = actor => true) {
|
||||
@@ -942,9 +944,9 @@ export class RdDUtility {
|
||||
content: `<p>Etes vous certain de vouloir supprimer: ${item.name}?</p>`,
|
||||
title: `Supprimer ${item.name}`,
|
||||
buttonLabel: "Supprimer",
|
||||
onAction: () => {
|
||||
onAction: async () => {
|
||||
console.log('Delete : ', itemId);
|
||||
actor.deleteEmbeddedDocuments('Item', [itemId], { renderSheet: false });
|
||||
await actor.deleteEmbeddedDocuments('Item', [itemId], { renderSheet: false });
|
||||
}
|
||||
};
|
||||
if (item.isConteneurNonVide()) {
|
||||
@@ -955,9 +957,9 @@ export class RdDUtility {
|
||||
'deleteall': {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Supprimer conteneur et contenu",
|
||||
callback: () => {
|
||||
callback: async () => {
|
||||
console.log("Delete : ", itemId);
|
||||
actor.deleteAllConteneur(itemId, { renderSheet: false });
|
||||
await actor.deleteAllConteneur(itemId, { renderSheet: false });
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -995,10 +997,10 @@ export class RdDUtility {
|
||||
}
|
||||
|
||||
/*-------------------------------------------- */
|
||||
static checkThanatosXP(item) {
|
||||
static async checkThanatosXP(item) {
|
||||
if (item.isCompetencePersonnage() && item.name.includes('Thanatos')) {
|
||||
let message = "Vous avez mis des points d'Expérience en Thanatos !<br>Vous devez réduire manuellement d'un même montant d'XP une autre compétence Draconique.";
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getUserAndGMs(),
|
||||
content: message
|
||||
});
|
||||
|
||||
@@ -47,8 +47,10 @@ export default class ChatRollResult {
|
||||
{
|
||||
content: await this.buildRollHtml(roll)
|
||||
},
|
||||
roll.active.actor,
|
||||
roll.current?.rollmode?.key
|
||||
{
|
||||
actor: roll.active.actor,
|
||||
rollMode: roll.current?.rollmode?.key
|
||||
}
|
||||
))
|
||||
|
||||
await this.saveChatMessageRoll(chatMessage, roll, impacts)
|
||||
@@ -200,6 +202,7 @@ export default class ChatRollResult {
|
||||
const chatMessage = ChatUtility.getChatMessage(event)
|
||||
const savedRoll = this.loadChatMessageRoll(chatMessage)
|
||||
const actor = this.getActiveActor(savedRoll)
|
||||
|
||||
Misc.doIfOwner(actor, it => it.rollAppelChance(
|
||||
() => this.onAppelChanceSuccess(savedRoll, chatMessage),
|
||||
() => this.onAppelChanceEchec(savedRoll, chatMessage))
|
||||
@@ -208,6 +211,7 @@ export default class ChatRollResult {
|
||||
|
||||
async onAppelChanceSuccess(roll, chatMessage) {
|
||||
roll.type.retry = true
|
||||
roll.type.appelChance = true
|
||||
await this.updateChatMessage(chatMessage, roll)
|
||||
|
||||
const callbacks = [ChatUtility.remover(chatMessage)]
|
||||
|
||||
@@ -9,6 +9,8 @@ export const ROLL_TYPE_MEDITATION = 'meditation'
|
||||
export const ROLL_TYPE_OEUVRE = 'oeuvre'
|
||||
export const ROLL_TYPE_SORT = 'sort'
|
||||
export const ROLL_TYPE_TACHE = 'tache'
|
||||
export const ROLL_TYPE_APPEL_CHANCE = 'appel-chance'
|
||||
export const ROLL_TYPE_REVE_RESISTANCE = 'reve-resistance'
|
||||
|
||||
export const ATTAQUE_ROLL_TYPES = [ROLL_TYPE_ATTAQUE]
|
||||
export const COMBAT_ROLL_TYPES = [ROLL_TYPE_ATTAQUE, ROLL_TYPE_DEFENSE]
|
||||
@@ -25,11 +27,18 @@ export const DIFF = {
|
||||
}
|
||||
|
||||
export const DIFFS = {
|
||||
[DIFF.LIBRE]: { key: DIFF.LIBRE, label: "Difficulté libre", libre: true, visible: true, max: 0 },
|
||||
[DIFF.ATTAQUE]: { key: DIFF.ATTAQUE, label: "Difficulté d'attaque", libre: true, visible: true, max: 0 },
|
||||
[DIFF.IMPOSEE]: { key: DIFF.IMPOSEE, label: "Difficulté imposée", libre: false, visible: true, max: 20 },
|
||||
[DIFF.DEFENSE]: { key: DIFF.DEFENSE, label: "Difficulté défense", libre: false, visible: true, max: 0 },
|
||||
[DIFF.LIBRE]: { key: DIFF.LIBRE, label: "Diff. libre", libre: true, visible: true, max: 0 },
|
||||
[DIFF.ATTAQUE]: { key: DIFF.ATTAQUE, label: "Diff. attaque", libre: true, visible: true, max: 0 },
|
||||
[DIFF.IMPOSEE]: { key: DIFF.IMPOSEE, label: "Diff. imposée", libre: false, visible: true, max: 20 },
|
||||
[DIFF.DEFENSE]: { key: DIFF.DEFENSE, label: "Diff. défense", libre: false, visible: true, max: 0 },
|
||||
[DIFF.DEFAUT]: { key: DIFF.DEFAUT, label: "Difficulté", libre: true, visible: true, max: 5 },
|
||||
[DIFF.AUCUN]: { key: DIFF.AUCUN, label: "", libre: false, visible: false, max: 0 },
|
||||
}
|
||||
|
||||
export class RollConstants {
|
||||
static findCompetence(rollData, name) {
|
||||
return rollData.active.actor.getCompetence(name, { onMessage: message => { } })
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,8 @@ import { RollPartResistance } from "./roll-part-resistance.mjs";
|
||||
import { RollTypePossession } from "./roll-type-possession.mjs";
|
||||
import { RollPartPossession } from "./roll-part-possession.mjs";
|
||||
import { RollPartApprecier } from "./roll-part-apprecier.mjs";
|
||||
import { RollTypeAppelChance } from "./roll-type-appel-chance.mjs";
|
||||
import { RollTypeReveResistance } from "./roll-type-resistance.mjs";
|
||||
|
||||
|
||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api
|
||||
@@ -65,7 +67,8 @@ export const ALL_ROLL_TYPES = [
|
||||
new RollTypeCuisine(),
|
||||
new RollTypeOeuvre(),
|
||||
new RollTypeJeu(),
|
||||
// new RollTypeResistance ??
|
||||
new RollTypeAppelChance(),
|
||||
new RollTypeReveResistance(),
|
||||
// new RollTypeFixedCarac ??
|
||||
]
|
||||
|
||||
@@ -77,7 +80,6 @@ const ROLL_PARTS = [
|
||||
new RollPartCarac(),
|
||||
new RollPartComp(),
|
||||
|
||||
new RollPartDiff(),
|
||||
new RollPartApprecier(),
|
||||
new RollPartAttaque(),
|
||||
new RollPartPossession(),
|
||||
@@ -88,18 +90,18 @@ const ROLL_PARTS = [
|
||||
new RollPartCuisine(),
|
||||
new RollPartOeuvre(),
|
||||
new RollPartJeu(),
|
||||
|
||||
new RollPartSign(),
|
||||
|
||||
new RollPartEcailles(),
|
||||
new RollPartEtat(),
|
||||
|
||||
new RollPartDiff(),
|
||||
new RollPartConditions(),
|
||||
new RollPartEtat(),
|
||||
new RollPartSign(),
|
||||
new RollPartEncTotal(),
|
||||
new RollPartSurEnc(),
|
||||
new RollPartEthylisme(),
|
||||
new RollPartEcailles(),
|
||||
new RollPartMalusArmure(),
|
||||
new RollPartEmpoignadeTaille(),
|
||||
new RollPartEmpoignade(),
|
||||
new RollPartEncTotal(),
|
||||
new RollPartSurEnc(),
|
||||
new RollPartAppelMoral(),
|
||||
new RollPartMoral(),
|
||||
new RollPartCoeur(),
|
||||
@@ -290,7 +292,6 @@ export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2
|
||||
return rollData.type?.allowed
|
||||
? ROLL_PARTS.filter(p => RollDialog.$isIntersecting(rollData.type.allowed, p.rollTypes))
|
||||
: ROLL_PARTS
|
||||
|
||||
}
|
||||
|
||||
/** pre-configure les paramètres des différentes parties de la fenêtre (par exemple, prépare les listes de caractéristiques/compétences */
|
||||
|
||||
@@ -35,7 +35,8 @@ export class RollPartAttaque extends RollPartSelect {
|
||||
|
||||
loadRefs(rollData) {
|
||||
const refs = this.getRefs(rollData)
|
||||
const attaques = rollData.active.actor.listAttaques()
|
||||
const attaques = rollData.active.actor.listActions()
|
||||
.filter(it => !it.initOnly)
|
||||
.sort(Misc.descending(it => it.comp?.system.niveau ?? -8))
|
||||
refs.all = attaques.map(it => RollPartAttaque.$extractAttaque(it, rollData))
|
||||
this.filterAttaquesInitiative(rollData)
|
||||
@@ -186,7 +187,9 @@ export class RollPartAttaque extends RollPartSelect {
|
||||
part.setDiff(rollData, { type: DIFF.DEFAUT })
|
||||
}
|
||||
else {
|
||||
part.setDiff(rollData, { type: DIFF.ATTAQUE, diff: current.initialDiff })
|
||||
if (!rollData.type.appelChance){
|
||||
part.setDiff(rollData, { type: DIFF.ATTAQUE, diff: current.initialDiff })
|
||||
}
|
||||
current.initialDiff = undefined
|
||||
}
|
||||
break
|
||||
|
||||
@@ -27,7 +27,7 @@ export class RollPartComp extends RollPartSelect {
|
||||
const selected = this.getSelected(rollData)
|
||||
const all = this.$getActorComps(rollData)
|
||||
const selectedComp = selected.key
|
||||
if (selected.forced && selectedComp) {
|
||||
if (selected.forced && selectedComp!= undefined ) {
|
||||
refs.all = all.filter(comp => Grammar.equalsInsensitive(comp.label, selectedComp))
|
||||
if (refs.all.length == 0) {
|
||||
if (selected.key && selected.key.length > 0) {
|
||||
@@ -47,8 +47,11 @@ export class RollPartComp extends RollPartSelect {
|
||||
const current = this.getCurrent(rollData)
|
||||
const selectedCarac = RollPart.getSelectedPart(rollData, PART_CARAC)
|
||||
const selectedDiff = RollPart.getSelectedPart(rollData, PART_DIFF)
|
||||
this.rollPartCarac.selectByKey(rollData, selectedCarac?.key ?? current.comp.system.defaut_carac)
|
||||
this.rollPartDiff.setDiff(rollData, selectedDiff?.value ?? current.comp.system.default_diffLibre)
|
||||
if (!rollData.type.appelChance){
|
||||
this.rollPartCarac.selectByKey(rollData, selectedCarac?.key ?? current.comp.system.defaut_carac)
|
||||
this.rollPartDiff.setDiff(rollData, selectedDiff?.value ?? current.comp.system.default_diffLibre)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,11 @@ export class RollPartConditions extends RollPart {
|
||||
settingMin() { return RollPart.settingKey(this, 'min') }
|
||||
settingMax() { return RollPart.settingKey(this, 'max') }
|
||||
|
||||
visible(rollData) {
|
||||
const current = this.getCurrent(rollData)
|
||||
return !current.hide
|
||||
}
|
||||
|
||||
onReady(rollParts) {
|
||||
game.settings.register(SYSTEM_RDD, this.settingMin(),
|
||||
{
|
||||
@@ -36,6 +41,7 @@ export class RollPartConditions extends RollPart {
|
||||
restore(rollData) {
|
||||
const current = this.getCurrent(rollData)
|
||||
current.value = this.getSaved(rollData)?.value ?? current.value ?? 0
|
||||
current.hide = this.getSaved(rollData)?.hide
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ITEM_TYPES } from "../constants.js"
|
||||
import { CARACS } from "../rdd-carac.js"
|
||||
import { ROLL_TYPE_CUISINE } from "./roll-constants.mjs"
|
||||
import { ROLL_TYPE_CUISINE, RollConstants } from "./roll-constants.mjs"
|
||||
import { PART_CARAC } from "./roll-part-carac.mjs"
|
||||
import { PART_COMP } from "./roll-part-comp.mjs"
|
||||
import { RollPartSelect } from "./roll-part-select.mjs"
|
||||
@@ -18,7 +18,11 @@ export class RollPartCuisine extends RollPartSelect {
|
||||
|
||||
get rollTypes() { return [ROLL_TYPE_CUISINE] }
|
||||
|
||||
isValid(rollData) { return rollData.active.actor.isPersonnage() }
|
||||
isValid(rollData) {
|
||||
return rollData.active.actor.isPersonnage()
|
||||
&& RollConstants.findCompetence(rollData, 'Cuisine')
|
||||
}
|
||||
|
||||
visible(rollData) { return RollPart.isRollType(rollData, ROLL_TYPE_CUISINE) }
|
||||
|
||||
restore(rollData) {
|
||||
@@ -38,14 +42,18 @@ export class RollPartCuisine extends RollPartSelect {
|
||||
|
||||
loadRefs(rollData) {
|
||||
const refs = this.getRefs(rollData)
|
||||
const actor = rollData.active.actor
|
||||
refs.cuisine = actor.getCompetence('Cuisine')
|
||||
refs.cuisine = RollConstants.findCompetence(rollData, 'Cuisine')
|
||||
|
||||
const recettes = actor.items
|
||||
if (!refs.cuisine) {
|
||||
refs.preparations = []
|
||||
return
|
||||
}
|
||||
|
||||
const recettes = rollData.active.actor.items
|
||||
.filter(it => it.type == ITEM_TYPES.recettecuisine)
|
||||
.map(it => RollPartCuisine.$extractPreparationRecette(refs.cuisine, it))
|
||||
|
||||
const ingredientsBruts = actor.items
|
||||
const ingredientsBruts = rollData.active.actor.items
|
||||
.filter(it => it.getUtilisationCuisine() == 'brut')
|
||||
.map(it => RollPartCuisine.$extractPreparationBrut(refs.cuisine, it))
|
||||
|
||||
|
||||
@@ -131,7 +131,11 @@ export class RollPartDefense extends RollPartSelect {
|
||||
switch (part.code) {
|
||||
case PART_CARAC: return part.filterCaracs(rollData, refs.defenses.length > 0 ? [current.carac] : ['impossible'])
|
||||
case PART_COMP: return part.filterComps(rollData, refs.defenses.length > 0 ? [current.comp?.name] : ['impossible'])
|
||||
case PART_DIFF: return part.setDiff(rollData, this.getDiffDefense(rollData))
|
||||
case PART_DIFF:
|
||||
if (!rollData.type.appelChance) {
|
||||
return part.setDiff(rollData, this.getDiffDefense(rollData))
|
||||
}
|
||||
return
|
||||
case PART_SIGN: return part.setArme(rollData, this.getArmeDisparate(rollData), current.forceRequise)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ const EXCLUDED_ROLL_TYPES = [
|
||||
export class RollPartDiff extends RollPart {
|
||||
|
||||
get code() { return PART_DIFF }
|
||||
get section() { return ROLLDIALOG_SECTION.CHOIX }
|
||||
get section() { return ROLLDIALOG_SECTION.CONDITIONS }
|
||||
|
||||
restore(rollData) {
|
||||
const current = this.getCurrent(rollData)
|
||||
@@ -37,7 +37,7 @@ export class RollPartDiff extends RollPart {
|
||||
}
|
||||
const current = this.getCurrent(rollData)
|
||||
/* TODO: affiner les cas où afficher ou non. devrait s'afficher pour les jets basiques (même si pas d'opposant sélectionné)*/
|
||||
return Object.values(DIFF).includes(current.type)
|
||||
return (DIFF.AUCUN !=current.type) && Object.values(DIFF).includes(current.type)
|
||||
}
|
||||
|
||||
prepareContext(rollData) {
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { ITEM_TYPES } from "../constants.js"
|
||||
import { CARACS } from "../rdd-carac.js"
|
||||
import { ROLL_TYPE_JEU } from "./roll-constants.mjs"
|
||||
import { ROLL_TYPE_JEU, RollConstants } from "./roll-constants.mjs"
|
||||
import { PART_CARAC } from "./roll-part-carac.mjs"
|
||||
import { PART_COMP, RollPartComp } from "./roll-part-comp.mjs"
|
||||
import { RollPartSelect } from "./roll-part-select.mjs"
|
||||
import { ROLLDIALOG_SECTION, RollPart } from "./roll-part.mjs"
|
||||
import { RdDItem } from "../item.js"
|
||||
import { Misc } from "../misc.js"
|
||||
import { Grammar } from "../grammar.js"
|
||||
|
||||
export const PART_JEU = "jeu"
|
||||
|
||||
@@ -19,15 +18,21 @@ export class RollPartJeu extends RollPartSelect {
|
||||
get section() { return ROLLDIALOG_SECTION.CHOIX }
|
||||
|
||||
get rollTypes() { return [ROLL_TYPE_JEU] }
|
||||
isValid(rollData) { return rollData.active.actor.isPersonnage() }
|
||||
isValid(rollData) {
|
||||
return rollData.active.actor.isPersonnage()
|
||||
&& RollConstants.findCompetence(rollData, 'Jeu')
|
||||
}
|
||||
|
||||
visible(rollData) { return RollPart.isRollType(rollData, ROLL_TYPE_JEU) }
|
||||
|
||||
loadRefs(rollData) {
|
||||
const refs = this.getRefs(rollData)
|
||||
const actor = rollData.active.actor
|
||||
const compJeu = actor.getCompetence(COMPETENCE_JEU)
|
||||
|
||||
refs.jeux = actor.itemTypes[ITEM_TYPES.jeu]
|
||||
const compJeu = RollConstants.findCompetence(rollData, 'Jeu')
|
||||
if (!compJeu) {
|
||||
refs.jeux = []
|
||||
return
|
||||
}
|
||||
refs.jeux = rollData.active.actor.itemTypes[ITEM_TYPES.jeu]
|
||||
.map(it => RollPartJeu.$extractJeu(it, compJeu))
|
||||
|
||||
if (refs.jeux.length > 0) {
|
||||
@@ -51,22 +56,22 @@ export class RollPartJeu extends RollPartSelect {
|
||||
}
|
||||
}
|
||||
|
||||
static $getJeuBase(jeu, comp, caracs) {
|
||||
if (jeu.system.base < comp.system.niveau) {
|
||||
static $getJeuBase(jeu, compJeu, caracs) {
|
||||
if (jeu.system.base < compJeu.system.niveau) {
|
||||
return undefined
|
||||
}
|
||||
return new RdDItem({
|
||||
id: comp.id,
|
||||
id: compJeu.id,
|
||||
name: `Jeu ${Misc.lowerFirst(jeu.name)}`,
|
||||
type: ITEM_TYPES.competence,
|
||||
img: comp.img,
|
||||
img: compJeu.img,
|
||||
system: foundry.utils.mergeObject(
|
||||
{
|
||||
niveau: jeu.system.base,
|
||||
base: jeu.system.base,
|
||||
default_carac: caracs.length > 0 ? caracs[0] : CARACS.CHANCE
|
||||
},
|
||||
comp.system,
|
||||
compJeu.system,
|
||||
{ overwrite: false }
|
||||
)
|
||||
})
|
||||
@@ -90,7 +95,7 @@ export class RollPartJeu extends RollPartSelect {
|
||||
|
||||
static forceCompJeu(rollData) {
|
||||
const jeu = rollData.current[PART_JEU].base ?? rollData.current[PART_JEU].comp
|
||||
if (jeu){
|
||||
if (jeu) {
|
||||
rollData.refs[PART_COMP].comps = [jeu].map(it => RollPartComp.extractComp(it))
|
||||
}
|
||||
else {
|
||||
|
||||
31
module/roll/roll-type-appel-chance.mjs
Normal file
31
module/roll/roll-type-appel-chance.mjs
Normal file
@@ -0,0 +1,31 @@
|
||||
import { CARACS } from "../rdd-carac.js"
|
||||
import { DIFF, ROLL_TYPE_APPEL_CHANCE } from "./roll-constants.mjs"
|
||||
import { RollType } from "./roll-type.mjs"
|
||||
|
||||
export class RollTypeAppelChance extends RollType {
|
||||
get code() { return ROLL_TYPE_APPEL_CHANCE }
|
||||
get name() { return `fait appel à la chance` }
|
||||
get icon() { return `systems/foundryvtt-reve-de-dragon/assets/ui/chance.svg` }
|
||||
get chatResultTemplate() { return `systems/foundryvtt-reve-de-dragon/templates/roll/result/chat-appel-chance.hbs` }
|
||||
|
||||
title(rollData) {
|
||||
return this.name
|
||||
}
|
||||
|
||||
setRollDataType(rollData) {
|
||||
foundry.utils.mergeObject(rollData, {
|
||||
selected: {
|
||||
carac: { key: CARACS.CHANCE_ACTUELLE, forced: true },
|
||||
diff: { value: 0, type: '' },
|
||||
comp: { key: '', forced: true },
|
||||
conditions: { hide: true }
|
||||
}
|
||||
})
|
||||
super.setRollDataType(rollData)
|
||||
}
|
||||
|
||||
onSelect(rollData) {
|
||||
this.setDiffType(rollData, DIFF.AUCUN)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ITEM_TYPES } from "../constants.js"
|
||||
import { APPRECIATION } from "../moral/apprecier.mjs"
|
||||
import { RollBasicParts } from "./roll-basic-parts.mjs"
|
||||
import { DIFF, ROLL_TYPE_CUISINE } from "./roll-constants.mjs"
|
||||
import { DIFF, ROLL_TYPE_CUISINE, RollConstants } from "./roll-constants.mjs"
|
||||
import { PART_CUISINE } from "./roll-part-cuisine.mjs"
|
||||
import { RollType } from "./roll-type.mjs"
|
||||
|
||||
@@ -9,7 +9,11 @@ export class RollTypeCuisine extends RollType {
|
||||
get code() { return ROLL_TYPE_CUISINE }
|
||||
get name() { return `Cuisiner un plat` }
|
||||
|
||||
visible(rollData) { return rollData.active.actor.isPersonnage() }
|
||||
visible(rollData) {
|
||||
return rollData.active.actor.isPersonnage()
|
||||
&& RollConstants.findCompetence(rollData, 'Cuisine')
|
||||
}
|
||||
|
||||
title(rollData) {
|
||||
const current = rollData.current[PART_CUISINE]
|
||||
return current.recette ? `prépare une recette: ${current.label}` : `prépare: ${current.label}`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { PART_JEU, RollPartJeu } from "./roll-part-jeu.mjs"
|
||||
import { RollType } from "./roll-type.mjs"
|
||||
import { DIFF, ROLL_TYPE_JEU } from "./roll-constants.mjs"
|
||||
import { DIFF, ROLL_TYPE_JEU, RollConstants } from "./roll-constants.mjs"
|
||||
import { Apprecier } from "../moral/apprecier.mjs"
|
||||
|
||||
|
||||
@@ -8,7 +8,11 @@ export class RollTypeJeu extends RollType {
|
||||
get code() { return ROLL_TYPE_JEU }
|
||||
get name() { return `Jouer` }
|
||||
|
||||
visible(rollData) { return rollData.active.actor.isPersonnage() }
|
||||
visible(rollData) {
|
||||
return rollData.active.actor.isPersonnage()
|
||||
&& RollConstants.findCompetence(rollData, 'Jeu')
|
||||
}
|
||||
|
||||
title(rollData) {
|
||||
if (rollData.opponent) {
|
||||
return `joue contre`
|
||||
|
||||
31
module/roll/roll-type-resistance.mjs
Normal file
31
module/roll/roll-type-resistance.mjs
Normal file
@@ -0,0 +1,31 @@
|
||||
import { CARACS } from "../rdd-carac.js"
|
||||
import { DIFF, ROLL_TYPE_REVE_RESISTANCE } from "./roll-constants.mjs"
|
||||
import { RollType } from "./roll-type.mjs"
|
||||
|
||||
export class RollTypeReveResistance extends RollType {
|
||||
get code() { return ROLL_TYPE_REVE_RESISTANCE }
|
||||
get name() { return `fait un jet de résistance` }
|
||||
get icon() { return `systems/foundryvtt-reve-de-dragon/assets/ui/resistance.svg` }
|
||||
get chatResultTemplate() { return `systems/foundryvtt-reve-de-dragon/templates/roll/result/chat-reve-resistance.hbs` }
|
||||
|
||||
title(rollData) {
|
||||
return this.name
|
||||
}
|
||||
|
||||
setRollDataType(rollData) {
|
||||
foundry.utils.mergeObject(rollData, {
|
||||
selected: {
|
||||
carac: { key: CARACS.REVE_ACTUEL, forced: true },
|
||||
diff: { value: -8, type: DIFF.LIBRE },
|
||||
comp: { key: '', forced: true },
|
||||
conditions: { hide: true }
|
||||
}
|
||||
})
|
||||
super.setRollDataType(rollData)
|
||||
}
|
||||
|
||||
onSelect(rollData) {
|
||||
this.setDiffType(rollData, DIFF.LIBRE)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ export class RollType {
|
||||
return { code: this.code, name: this.name, icon: this.icon, section: 'type', template: this.template, selected: this.isSelected(rollData) }
|
||||
}
|
||||
|
||||
prepare(rollData){}
|
||||
prepare(rollData) {}
|
||||
isAllowed(rollData) { return rollData.type.allowed == undefined || rollData.type.allowed.includes(this.code) }
|
||||
visible(rollData) { return true }
|
||||
title(rollData) { return this.code }
|
||||
|
||||
@@ -10,7 +10,7 @@ const listeReglesOptionnelles = [
|
||||
{ group: 'Récupération', name: 'recuperation-reve', descr: "Récupérer le rêve pendant la nuit (les jets sont toujours faits pour les Rêves de Dragons)"},
|
||||
{ group: 'Récupération', name: 'recuperation-moral', descr: "Le moral revient vers 0 durant Château Dormant"},
|
||||
|
||||
|
||||
{ group: 'Règles de combat', name: 'armes-equipees', descr: "Proposer uniquement les armes équipées au combat", default: false},
|
||||
{ group: 'Règles de combat', name: 'localisation-aleatoire', descr: "Proposer une localisation aléatoire des blessures" },
|
||||
{ group: 'Règles de combat', name: 'recul', descr: "Appliquer le recul en cas de particulière en force ou de charge" },
|
||||
{ group: 'Règles de combat', name: 'acrobatie-pour-recul', descr: "L'acrobatie aide à ne pas chuter en cas de recul" , default: false },
|
||||
|
||||
@@ -8,7 +8,7 @@ export class DialogRepos extends Dialog {
|
||||
if (!actor.isPersonnage()) {
|
||||
return
|
||||
}
|
||||
if (!ReglesOptionnelles.isUsing("chateau-dormant-gardien") || !actor.hasPlayerOwner) {
|
||||
if (!ReglesOptionnelles.isUsing("chateau-dormant-gardien") || !actor.isPersonnageJoueur()) {
|
||||
foundry.utils.mergeObject(actor.system.sommeil, {
|
||||
"nouveaujour": true,
|
||||
"insomnie": EffetsDraconiques.isSujetInsomnie(actor),
|
||||
|
||||
@@ -280,7 +280,7 @@ export class RdDCalendrier extends Application {
|
||||
/* -------------------------------------------- */
|
||||
async setNewTimestamp(newTimestamp) {
|
||||
const oldTimestamp = this.timestamp;
|
||||
await Promise.all(game.actors.map(async actor => await actor.onTimeChanging(oldTimestamp, newTimestamp)));
|
||||
await Promise.all(game.actors.map(actor => actor.onTimeChanging(oldTimestamp, newTimestamp)))
|
||||
RdDTimestamp.setWorldTime(newTimestamp);
|
||||
if (oldTimestamp.indexDate + 1 == newTimestamp.indexDate && ReglesOptionnelles.isUsing("chateau-dormant-gardien")) {
|
||||
await DialogChateauDormant.create();
|
||||
|
||||
@@ -103,7 +103,7 @@ export class EffetsRencontre {
|
||||
tete: context.rolled.isPart,
|
||||
poesie: await Poetique.getExtrait()
|
||||
})
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(context.actor),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-reve-de-dragon.hbs`, context)
|
||||
});
|
||||
@@ -118,7 +118,7 @@ export class EffetsRencontre {
|
||||
context.queues.push(await context.actor.ajouterQueue());
|
||||
}
|
||||
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(context.actor),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-reve-de-dragon.hbs`, context)
|
||||
});
|
||||
|
||||
@@ -27,13 +27,13 @@ export class PresentCites extends Draconique {
|
||||
async _ajouterPresents(actor, tete) {
|
||||
let existants = actor.items.filter(it => this.isCase(it)).map(it => it.system.coord);
|
||||
if (existants.length > 0) {
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(actor),
|
||||
content: "Vous avez encore des présents dans des cités, vous devrez tirer une autre tête pour remplacer celle ci!"
|
||||
})
|
||||
}
|
||||
else {
|
||||
let cites = TMRUtility.filterTMR(it => it.type == 'cite');
|
||||
let cites = TMRUtility.filterTMR(it => it.type == 'cite')
|
||||
for (let tmr of cites) {
|
||||
await this.createCaseTmr(actor, 'Présent', tmr, tete.id);
|
||||
}
|
||||
@@ -43,7 +43,7 @@ export class PresentCites extends Draconique {
|
||||
async choisirUnPresent(casetmr, onChoixPresent) {
|
||||
const presents = await game.system.rdd.rencontresTMR.getPresentsCite()
|
||||
const buttons = {};
|
||||
presents.forEach(r => buttons['present'+r.id] = { icon: '<i class="fas fa-check"></i>', label: r.name, callback: async () => onChoixPresent(r) });
|
||||
presents.forEach(r => buttons['present' + r.id] = { icon: '<i class="fas fa-check"></i>', label: r.name, callback: async () => onChoixPresent(r) });
|
||||
let dialog = new Dialog({
|
||||
title: "Présent des cités",
|
||||
content: `La ${this.tmrLabel(casetmr)} vous offre un présent, faites votre choix`,
|
||||
|
||||
@@ -18,7 +18,7 @@ export class UrgenceDraconique extends Draconique {
|
||||
if (coordSortsReserve.length == 0) {
|
||||
// La queue se transforme en idée fixe
|
||||
const ideeFixe = await RdDRollTables.getIdeeFixe();
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(actor),
|
||||
content: `En l'absence de sorts en réserve, l'urgence draconique de ${actor.name} se transforme en ${ideeFixe.name}`
|
||||
});
|
||||
|
||||
@@ -174,7 +174,7 @@ export class DialogFatigueVoyage extends Dialog {
|
||||
.filter(it => it.selected)
|
||||
.forEach(async it => {
|
||||
const perteFatigue = fatigueBase + it.ajustement
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(it.actor),
|
||||
content: await renderTemplate(
|
||||
'systems/foundryvtt-reve-de-dragon/templates/voyage/chat-fatigue_voyage.hbs',
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.8.0",
|
||||
"@foundryvtt/foundryvtt-cli": "^1.0.3",
|
||||
"@foundryvtt/foundryvtt-cli": "^3.0.3",
|
||||
"commander": "^11.1.0",
|
||||
"eslint": "^9.9.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
|
||||
@@ -2347,7 +2347,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2395,7 +2395,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 7
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2443,7 +2443,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2611,7 +2611,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 6
|
||||
categorie_parade: ''
|
||||
categorie_parade: haches
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2418,7 +2418,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2466,7 +2466,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2378,7 +2378,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2527,7 +2527,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 14
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-lourdes
|
||||
dommages: 4/5
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2347,7 +2347,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2735,7 +2735,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 6
|
||||
categorie_parade: ''
|
||||
categorie_parade: haches
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2378,7 +2378,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2665,7 +2665,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 10
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2354,7 +2354,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-lourdes
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2402,7 +2402,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2548,7 +2548,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 13
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2354,7 +2354,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-lourdes
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2402,7 +2402,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2480,7 +2480,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2390,7 +2390,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-lourdes
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2438,7 +2438,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2516,7 +2516,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 13
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2564,7 +2564,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2390,7 +2390,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-lourdes
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2438,7 +2438,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2516,7 +2516,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2653,7 +2653,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2706,7 +2706,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 1
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2653,7 +2653,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2706,7 +2706,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 1
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2711,7 +2711,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2345,7 +2345,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2346,7 +2346,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2313,7 +2313,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2346,7 +2346,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2424,7 +2424,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2346,7 +2346,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2424,7 +2424,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -22,7 +22,7 @@ system:
|
||||
rarete: Frequente
|
||||
frequence: 18
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: batons
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -27,7 +27,7 @@ system:
|
||||
rarete: Frequente
|
||||
frequence: 18
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -22,7 +22,7 @@ system:
|
||||
rarete: Frequente
|
||||
frequence: 18
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: batons
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -22,7 +22,7 @@ system:
|
||||
rarete: Frequente
|
||||
frequence: 18
|
||||
resistance: 7
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -22,7 +22,7 @@ system:
|
||||
rarete: Frequente
|
||||
frequence: 18
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -22,7 +22,7 @@ system:
|
||||
rarete: Frequente
|
||||
frequence: 18
|
||||
resistance: 10
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -22,7 +22,7 @@ system:
|
||||
rarete: Frequente
|
||||
frequence: 18
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2417,7 +2417,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2466,7 +2466,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 13
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2569,7 +2569,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2382,7 +2382,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 12
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-longues
|
||||
dommages: 3
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2441,7 +2441,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-lourdes
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2380,7 +2380,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: haches
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2429,7 +2429,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 10
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2380,7 +2380,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 10
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2380,7 +2380,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 10
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2434,7 +2434,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2420,7 +2420,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 12
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-courtes
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2380,7 +2380,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 10
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 3/3
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2464,7 +2464,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2380,7 +2380,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2429,7 +2429,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2380,7 +2380,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2434,7 +2434,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2483,7 +2483,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2532,7 +2532,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2380,7 +2380,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2429,7 +2429,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 13
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2380,7 +2380,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2478,7 +2478,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 13
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -311,7 +311,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-lourdes
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -359,7 +359,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -407,7 +407,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"id": "foundryvtt-reve-de-dragon",
|
||||
"title": "Rêve de Dragon",
|
||||
"version": "13.0.21",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/releases/download/13.0.0/rddsystem.zip",
|
||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/releases/download/13.0.0/system.json",
|
||||
"changelog": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md",
|
||||
"version": "13.0.43",
|
||||
"download": "https://gitea.scriptarium.org/Scriptarium/foundryvtt-reve-de-dragon/releases/download/13.0.43/rddsystem.zip",
|
||||
"manifest": "https://gitea.scriptarium.org/Scriptarium/foundryvtt-reve-de-dragon/releases/download/latest/system.json",
|
||||
"changelog": "https://gitea.scriptarium.org/Scriptarium/foundryvtt-reve-de-dragon/raw/branch/v13/changelog.md",
|
||||
"compatibility": {
|
||||
"minimum": "13",
|
||||
"verified": "14"
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
<div>
|
||||
<ul class="item-list">
|
||||
<li><a class="repartition-archetype-aleatoire chat-card-button flexrow" data-tooltip="Répartition aléatoire des niveaux d'archétype restants">
|
||||
<i class="fa-solid fa-circle-user-clock"></i><i class="fa-solid fa-shuffle"></i></a>
|
||||
{{#if @root.options.isGM}}
|
||||
<li>
|
||||
<a class="nouvelle-incarnation chat-card-button" data-tooltip="Création d'une nouvelle incarnation de l'archétype">
|
||||
<i class="fa-solid fa-person-circle-plus"></i> Nouvelle incarnation</a>
|
||||
<a class="nouvelle-incarnation chat-card-button flexrow" data-tooltip="Création d'une nouvelle incarnation de l'archétype">
|
||||
<i class="fa-regular fa-skull"></i><i class="fa-solid fa-person-circle-plus"></i></a>
|
||||
</li>
|
||||
{{/if}}
|
||||
<li><hr></li>
|
||||
<li>Niveaux d'archétype</li>
|
||||
{{#if calc.comptageArchetype}}
|
||||
{{#each calc.comptageArchetype as |archetype|}}
|
||||
|
||||
<li class="item flexrow">
|
||||
<label class="generic-label">
|
||||
Niveaux {{plusMoins archetype.niveau}} : {{archetype.nombre}} / {{archetype.nombreMax}}
|
||||
</label>
|
||||
</li>
|
||||
<li class="item flexrow">
|
||||
<label class="generic-label">
|
||||
Niveaux {{plusMoins archetype.niveau}} : {{archetype.nombre}} / {{archetype.nombreMax}}
|
||||
</label>
|
||||
</li>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
</ul>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</li>
|
||||
<br>
|
||||
<li class="caracteristique flexrow list-item">
|
||||
<label>{{system.compteurs.moral.label}}
|
||||
<label data-tooltip-html="{{> "systems/foundryvtt-reve-de-dragon/templates/actor/tooltip-bonmoments.hbs"}}">{{system.compteurs.moral.label}}
|
||||
<span>
|
||||
<a class="flex-shrink moral-malheureux" data-tooltip="Jet de moral situation malheureuse"><i class="fa-regular fa-face-frown"></i></a>
|
||||
<a class="flex-shrink moral-neutre" data-tooltip="Jet de moral situation neutre"><i class="fa-regular fa-face-meh"></i></a>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user