Merge branch 'working' into 'master'
Fix de la récupération fatigue & boutons d'actions See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!25
Before Width: | Height: | Size: 3.3 KiB |
58
icons/heures/hd05.svg
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="44.0995mm"
|
||||||
|
height="44.0995mm"
|
||||||
|
viewBox="0 0 250 250"
|
||||||
|
version="1.1"
|
||||||
|
id="svg3"
|
||||||
|
sodipodi:docname="hd05.svg"
|
||||||
|
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
|
||||||
|
<metadata
|
||||||
|
id="metadata9">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs7" />
|
||||||
|
<sodipodi:namedview
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="881"
|
||||||
|
inkscape:window-height="480"
|
||||||
|
id="namedview5"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="6.0476878"
|
||||||
|
inkscape:cx="83.337635"
|
||||||
|
inkscape:cy="83.337635"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
inkscape:current-layer="svg3" />
|
||||||
|
<path
|
||||||
|
id="Sélection"
|
||||||
|
fill="none"
|
||||||
|
stroke="black"
|
||||||
|
stroke-width="1"
|
||||||
|
d="M 98.00,39.00 C 104.37,41.03 108.79,45.33 114.00,49.35 114.00,49.35 141.00,68.80 141.00,68.80 145.95,71.80 157.43,75.86 160.00,80.00 151.99,79.61 145.44,76.06 138.00,73.32 134.63,72.08 130.70,70.21 127.04,71.24 125.22,71.75 124.14,72.58 123.09,74.14 120.99,77.27 118.46,89.46 121.40,92.30 126.99,97.69 139.54,89.73 143.97,98.06 145.89,101.65 143.71,105.37 143.21,109.00 142.45,114.46 142.94,123.68 144.43,129.00 146.90,137.81 149.99,144.61 155.48,152.00 159.39,157.26 165.49,162.68 168.00,168.00 149.35,160.92 137.02,149.38 131.21,130.00 129.86,125.51 128.65,117.74 128.17,113.00 127.83,109.67 128.19,106.09 125.43,103.59 123.52,101.87 115.92,100.67 113.00,99.85 113.00,99.85 87.00,91.42 87.00,91.42 84.20,90.80 76.77,88.69 75.29,92.31 74.23,94.92 79.37,102.34 80.74,105.00 84.82,112.90 88.37,121.20 89.92,130.00 89.92,130.00 92.02,146.86 92.02,146.86 94.27,150.71 102.85,151.96 107.00,153.36 115.10,156.08 125.51,161.42 131.00,168.00 126.53,166.73 125.02,165.59 121.00,163.87 112.41,160.20 103.22,158.43 94.00,157.28 89.82,156.76 79.35,156.54 76.60,153.49 73.74,150.32 75.56,142.93 75.93,139.00 76.78,129.78 76.45,120.92 73.65,112.00 70.44,101.77 65.56,92.68 57.99,85.00 52.24,79.18 44.49,75.38 41.00,68.00 41.00,68.00 90.00,86.85 90.00,86.85 93.16,87.71 104.80,90.80 107.40,88.31 108.73,86.69 107.61,81.43 107.40,79.00 107.82,59.49 102.23,54.68 98.00,39.00 Z M 34.11,181.00 C 40.60,182.26 45.30,186.55 51.00,190.00 52.90,191.15 56.91,193.29 57.84,195.29 59.27,198.40 55.28,199.88 56.68,204.01 58.94,210.71 71.35,215.81 78.00,214.64 79.80,214.33 81.43,213.64 82.96,212.66 95.64,204.48 78.62,193.89 73.11,187.96 71.14,185.85 69.68,183.92 69.24,181.00 67.13,166.96 84.13,170.12 92.00,172.44 116.36,179.62 137.88,205.28 164.00,188.45 167.46,186.22 171.09,183.08 173.82,180.00 193.36,157.94 179.27,126.82 179.00,104.00 178.88,93.46 179.12,77.25 191.00,72.74 201.87,68.60 226.22,82.46 220.11,96.90 218.03,101.81 212.47,102.10 208.02,100.53 206.19,99.88 202.82,97.98 204.17,95.54 205.18,93.70 210.19,93.24 210.68,88.98 211.12,85.09 205.20,78.98 199.00,81.73 191.98,84.84 188.65,91.59 189.18,99.00 189.83,108.04 192.45,116.31 194.63,125.00 200.94,150.27 202.39,189.15 173.00,200.53 167.38,202.71 161.94,203.06 156.00,203.00 140.14,202.82 124.54,194.37 111.00,186.86 106.21,184.21 93.11,176.64 88.00,178.06 83.00,179.45 81.32,183.60 84.03,188.00 88.51,195.26 107.85,204.83 98.57,216.96 97.42,218.47 95.60,220.10 94.00,221.11 91.52,222.66 89.84,222.88 87.00,222.98 76.33,223.37 67.85,220.03 59.00,214.30 59.00,214.30 49.00,207.02 49.00,207.02 43.20,204.22 36.26,210.05 34.11,202.94 34.03,201.89 34.02,200.11 34.11,199.00 34.11,199.00 34.11,181.00 34.11,181.00 Z"
|
||||||
|
style="stroke:none;fill:#ffffff" />
|
||||||
|
</svg>
|
After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 2.1 KiB |
58
icons/heures/hd08.svg
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="44.0995mm"
|
||||||
|
height="44.0995mm"
|
||||||
|
viewBox="0 0 250 250"
|
||||||
|
version="1.1"
|
||||||
|
id="svg3"
|
||||||
|
sodipodi:docname="hd08.svg"
|
||||||
|
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
|
||||||
|
<metadata
|
||||||
|
id="metadata9">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs7" />
|
||||||
|
<sodipodi:namedview
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1742"
|
||||||
|
inkscape:window-height="1326"
|
||||||
|
id="namedview5"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="6.0476878"
|
||||||
|
inkscape:cx="83.337635"
|
||||||
|
inkscape:cy="83.337635"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
inkscape:current-layer="svg3" />
|
||||||
|
<path
|
||||||
|
id="Sélection"
|
||||||
|
fill="none"
|
||||||
|
stroke="black"
|
||||||
|
stroke-width="1"
|
||||||
|
d="M 52.00,130.00 C 53.85,124.67 61.10,123.93 66.00,122.34 66.00,122.34 76.00,119.00 76.00,119.00 82.04,118.18 86.75,122.19 87.42,128.00 88.15,131.16 87.40,133.04 87.42,136.00 86.76,141.34 89.78,147.40 96.00,145.46 101.06,143.87 112.60,134.73 120.00,134.11 125.88,133.61 130.92,135.79 132.28,142.00 133.57,147.92 127.52,158.96 127.09,166.00 125.97,184.34 152.19,197.73 167.24,178.91 176.80,166.96 179.68,147.49 169.48,135.04 164.13,128.50 155.45,124.43 148.00,120.76 138.93,116.29 120.90,108.08 124.81,95.00 125.79,91.71 128.59,87.80 131.29,85.70 133.23,84.19 137.60,82.43 140.00,81.42 149.54,77.42 167.00,72.05 175.55,80.79 178.58,83.88 176.90,86.82 173.89,89.04 168.96,92.67 161.12,95.70 155.00,96.00 155.88,93.85 158.12,90.22 157.55,88.04 155.59,80.55 140.46,83.79 139.50,92.00 138.67,99.05 150.46,108.81 156.00,111.74 166.86,117.48 183.61,123.01 187.36,136.00 188.13,138.65 188.03,142.22 188.00,145.00 187.91,152.60 186.28,162.28 182.68,169.00 175.19,182.96 153.25,197.59 137.00,196.51 132.61,196.22 125.65,193.35 122.00,190.90 111.19,183.62 112.68,174.83 115.98,164.00 117.25,159.82 119.98,151.93 117.39,148.06 114.26,143.38 110.37,144.37 106.00,146.31 101.20,148.44 88.46,155.23 84.00,155.77 67.93,157.75 77.68,138.65 71.49,131.14 66.64,125.26 58.25,129.12 52.00,130.00 Z"
|
||||||
|
style="stroke:none;fill:#ffffff" />
|
||||||
|
</svg>
|
After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 3.2 KiB |
58
icons/heures/hd12.svg
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="44.0995mm"
|
||||||
|
height="44.0995mm"
|
||||||
|
viewBox="0 0 250 250"
|
||||||
|
version="1.1"
|
||||||
|
id="svg3"
|
||||||
|
sodipodi:docname="hd12.svg"
|
||||||
|
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
|
||||||
|
<metadata
|
||||||
|
id="metadata9">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs7" />
|
||||||
|
<sodipodi:namedview
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1677"
|
||||||
|
inkscape:window-height="1199"
|
||||||
|
id="namedview5"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="6.0476878"
|
||||||
|
inkscape:cx="83.337635"
|
||||||
|
inkscape:cy="83.337635"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
inkscape:current-layer="svg3" />
|
||||||
|
<path
|
||||||
|
id="Sélection"
|
||||||
|
fill="none"
|
||||||
|
stroke="black"
|
||||||
|
stroke-width="1"
|
||||||
|
d="M 102.00,85.00 C 103.52,80.22 108.58,75.80 111.95,72.00 111.95,72.00 129.04,52.00 129.04,52.00 131.05,49.89 136.07,44.32 138.91,44.03 141.98,43.71 146.79,50.73 148.73,53.00 155.56,60.97 172.57,75.08 175.00,84.00 175.00,84.00 149.00,87.00 149.00,87.00 153.29,92.15 156.10,92.61 156.82,100.00 157.46,106.55 153.87,113.90 158.70,119.73 162.56,124.38 171.39,125.40 175.61,120.85 178.19,118.07 179.15,113.97 182.21,111.74 184.59,110.00 187.21,110.04 190.00,110.00 190.00,110.00 215.00,111.00 215.00,111.00 215.00,111.00 214.01,126.00 214.01,126.00 213.76,137.17 217.00,155.49 218.58,167.00 218.58,167.00 219.22,174.00 219.22,174.00 220.68,182.36 230.05,186.01 228.81,197.00 227.58,207.94 217.04,214.55 207.00,216.00 210.12,209.40 214.10,208.12 216.42,203.00 221.54,191.67 205.81,177.37 195.00,178.10 188.87,178.50 181.51,183.14 176.43,178.99 172.59,175.86 175.57,172.15 171.35,166.00 163.04,153.90 145.57,146.08 131.00,147.09 118.57,147.95 105.08,155.07 95.00,162.02 91.86,164.19 82.69,171.58 80.00,172.40 74.35,174.13 70.62,168.55 65.00,165.92 56.00,161.70 50.05,164.60 43.04,170.62 33.18,179.08 27.52,193.04 37.21,203.96 43.94,211.55 52.20,211.38 50.34,216.83 48.69,221.67 39.23,222.53 35.00,221.61 25.95,219.65 21.12,210.66 21.00,202.00 20.81,188.03 24.29,180.65 35.00,171.29 35.00,171.29 49.28,159.70 49.28,159.70 52.38,155.57 53.97,138.57 54.00,133.00 54.02,129.36 54.86,112.57 55.89,110.04 56.59,108.33 57.51,107.11 59.13,106.17 61.27,104.95 70.35,104.64 74.00,103.88 77.02,103.25 83.02,100.59 85.69,102.11 89.88,104.50 86.81,114.70 88.60,118.86 90.35,122.94 96.23,122.95 100.00,123.00 103.13,123.03 108.13,123.24 110.86,121.69 116.54,118.46 115.69,103.16 117.80,97.04 119.78,91.30 122.77,93.12 126.00,87.00 113.39,84.46 114.66,85.00 102.00,85.00 Z M 152.00,80.00 C 151.84,78.07 151.89,76.83 150.98,75.00 148.96,70.96 140.96,63.07 136.00,63.91 128.98,65.09 120.86,73.73 118.00,80.00 125.55,82.97 142.99,80.00 152.00,80.00 Z M 190.00,173.00 C 193.41,173.00 200.06,173.61 202.69,171.40 205.61,168.94 204.85,165.28 204.21,162.00 204.21,162.00 204.21,144.00 204.21,144.00 204.21,144.00 203.18,130.00 203.18,130.00 203.40,126.88 204.56,122.21 203.69,119.13 202.70,115.68 199.07,114.76 196.04,116.21 190.21,119.02 192.06,125.43 185.96,128.96 179.03,132.71 165.81,129.71 158.00,128.96 154.03,128.77 149.60,128.88 146.70,125.58 143.35,121.79 144.05,114.76 144.00,110.00 143.93,104.57 142.71,92.24 134.11,95.87 129.96,97.61 130.24,101.27 129.84,105.00 129.09,111.80 129.71,125.23 122.96,128.57 120.63,129.72 105.07,131.06 102.00,130.96 102.00,130.96 92.00,130.00 92.00,130.00 88.23,129.82 82.09,129.48 79.31,126.69 74.72,122.07 79.63,112.61 72.94,110.45 68.77,109.10 66.17,113.75 65.17,117.00 63.69,121.87 62.07,137.69 62.00,143.00 61.96,146.67 61.66,151.65 63.45,154.90 67.32,161.89 78.89,164.05 86.00,161.96 97.27,158.65 100.61,151.89 115.00,145.14 132.59,137.26 154.51,136.17 172.00,145.14 182.48,150.24 189.85,156.60 190.00,169.00 190.00,169.00 190.00,173.00 190.00,173.00 Z"
|
||||||
|
style="stroke:none;fill:#ffffff" />
|
||||||
|
</svg>
|
After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 15 KiB |
107
module/actor.js
@ -332,39 +332,47 @@ export class RdDActor extends Actor {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async dormir(heures=1) {
|
async dormir(heures=1) {
|
||||||
let message = { title : "Récupération", content :"Vous dormez " + heures + " heure" + (heures > 1 ? "s": "") };
|
let message = { title : "Récupération", content :"Vous dormez " + heures + " heure" + (heures > 1 ? "s": "") };
|
||||||
this.recupereEndurance(message);
|
await this.recupereEndurance(message);
|
||||||
for (let i=0; i<heures; i++) {
|
for (let i=0; i<heures; i++) {
|
||||||
await this.recupererFatigueUneHeure(message);
|
await this.recupererFatigue(message);
|
||||||
this.recuperationReve(message);
|
await this.recuperationReve(message);
|
||||||
}
|
}
|
||||||
ChatMessage.create( message );
|
ChatMessage.create( message );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
recupereEndurance(message) {
|
async recupereEndurance(message) {
|
||||||
const avant = this.data.data.sante.endurance.value;
|
const manquant = this._computeEnduranceMax() - this.data.data.sante.endurance.value;
|
||||||
this.santeIncDec("endurance", this.data.data.sante.endurance.max - avant);
|
if (manquant > 0) {
|
||||||
const recupere = this.data.data.sante.endurance.value - avant;
|
await this.santeIncDec("endurance", manquant);
|
||||||
if (recupere>0) {
|
message.content += "<br>Vous récuperez " + manquant + " points d'endurance";
|
||||||
message.content += "<br>Vous récuperez " + recupere + " points d'endurance";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async recupererFatigueUneHeure(message) {
|
async recupererFatigue(message) {
|
||||||
let fatigue = duplicate(this.data.data.sante.fatigue)
|
let fatigue = duplicate(this.data.data.sante.fatigue)
|
||||||
if (fatigue.value == 0) {
|
const fatigueMin = this._computeFatigueMin();
|
||||||
|
if (fatigue.value <= fatigueMin) {
|
||||||
message.content += "<br>Vous êtes déjà reposé";
|
message.content += "<br>Vous êtes déjà reposé";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
fatigue.value = Math.max(fatigueMin, this._calculRecuperationSegment(fatigue.value));
|
||||||
|
console.log("recupererFatigue", fatigue)
|
||||||
|
await this.update( {"data.sante.fatigue": fatigue } );
|
||||||
|
if (fatigue.value == 0)
|
||||||
|
{
|
||||||
|
message.content += "<br>Vous êtes bien reposé";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_calculRecuperationSegment(actuel)
|
||||||
|
{
|
||||||
const segments = RdDUtility.getSegmentsFatigue(this.data.data.sante.endurance.max);
|
const segments = RdDUtility.getSegmentsFatigue(this.data.data.sante.endurance.max);
|
||||||
let cumul = 0;
|
let cumul = 0;
|
||||||
console.log("recupererFatigue", segments);
|
|
||||||
|
|
||||||
let i;
|
let i;
|
||||||
for (i=0; i <11; i++) {
|
for (i=0; i <11; i++) {
|
||||||
cumul += segments[i];
|
cumul += segments[i];
|
||||||
let diff = cumul - fatigue.value ;
|
let diff = cumul - actuel;
|
||||||
if (diff >= 0)
|
if (diff >= 0)
|
||||||
{
|
{
|
||||||
const limit2Segments = Math.floor(segments[i] / 2);
|
const limit2Segments = Math.floor(segments[i] / 2);
|
||||||
@ -374,17 +382,11 @@ export class RdDActor extends Actor {
|
|||||||
cumul -= segments[i];
|
cumul -= segments[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
fatigue.value = cumul;
|
return cumul;
|
||||||
await this.update( {"data.sante.fatigue": fatigue } );
|
|
||||||
if (fatigue.value == 0)
|
|
||||||
{
|
|
||||||
message.content += "<br>Vous êtes bien reposé";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
recuperationReve(message) {
|
async recuperationReve(message) {
|
||||||
const seuil = this.data.data.reve.seuil.value;
|
const seuil = this.data.data.reve.seuil.value;
|
||||||
const reve = this.getReveActuel();
|
const reve = this.getReveActuel();
|
||||||
if (reve >= seuil) {
|
if (reve >= seuil) {
|
||||||
@ -740,9 +742,9 @@ export class RdDActor extends Actor {
|
|||||||
testSiSonne( sante, endurance )
|
testSiSonne( sante, endurance )
|
||||||
{
|
{
|
||||||
let result = new Roll("d20").roll().total;
|
let result = new Roll("d20").roll().total;
|
||||||
if ( result <= endurance.value)
|
if ( result <= endurance)
|
||||||
sante.sonne.value = false;
|
sante.sonne.value = false;
|
||||||
if ( result > endurance.value || result == 20) // 20 is always a failure
|
if ( result > endurance || result == 20) // 20 is always a failure
|
||||||
sante.sonne.value = true;
|
sante.sonne.value = true;
|
||||||
if (result == 1) {
|
if (result == 1) {
|
||||||
sante.sonne.value = false;
|
sante.sonne.value = false;
|
||||||
@ -766,44 +768,51 @@ export class RdDActor extends Actor {
|
|||||||
async santeIncDec(name, inc ) {
|
async santeIncDec(name, inc ) {
|
||||||
const sante = duplicate(this.data.data.sante);
|
const sante = duplicate(this.data.data.sante);
|
||||||
let data = sante[name];
|
let data = sante[name];
|
||||||
let lastValue = data.value; // Useful for Endurance and Sonné
|
let minValue = name == "vie" ? - this.data.data.attributs.sconst : 0;
|
||||||
data.value = data.value + inc;
|
let newValue = Math.max(minValue, Math.min(data.value + inc, data.max));
|
||||||
if ( data.value > data.max ) data.value = data.max;
|
|
||||||
if ( data.value < 0 ) data.value = 0;
|
|
||||||
|
|
||||||
if (name == "endurance" && this.data.type != 'entite' ) {
|
if (name == "endurance" && this.data.type != 'entite' ) {
|
||||||
if ( sante.fatigue && inc < 0 ) { // Each endurance lost -> fatigue lost
|
if ( sante.fatigue && inc < 0 ) { // Each endurance lost -> fatigue lost
|
||||||
sante.fatigue.value = sante.fatigue.value - inc
|
sante.fatigue.value = sante.fatigue.value - inc
|
||||||
}
|
}
|
||||||
// If endurance is 0 -> -1 vie
|
if ( newValue == 0 && inc < 0) { // perte endurance et endurance devient 0 -> -1 vie
|
||||||
if ( data.value == 0 && sante.vie.value > 0) {
|
|
||||||
sante.vie.value = sante.vie.value - 1;
|
sante.vie.value = sante.vie.value - 1;
|
||||||
}
|
}
|
||||||
let diffVie = sante.vie.max - sante.vie.value;
|
newValue = Math.max(0, newValue);
|
||||||
if ( data.value > data.max - (diffVie*2) ) {
|
if (inc>0) { // le max d'endurance s'applique seulement à la récupération
|
||||||
data.value = data.max - (diffVie*2);
|
newValue = Math.max(newValue, this._computeEnduranceMax())
|
||||||
|
}
|
||||||
|
if (data.value - newValue > 1) {
|
||||||
|
this.testSiSonne(sante, newValue); // Peut-être sonné si 2 points d'endurance perdus d'un coup
|
||||||
|
} else if (inc>0) {
|
||||||
|
sante.sonne.value = false;
|
||||||
}
|
}
|
||||||
if ( data.value < 0 ) data.value = 0; // Security
|
|
||||||
|
|
||||||
let blessures = this.data.data.blessures;
|
|
||||||
let nbGraves = this.GetNumberBlessures(blessures.graves.liste);
|
|
||||||
let nbCritiques = this.GetNumberBlessures(blessures.critiques.liste);
|
|
||||||
let maxEnd = Math.floor( data.max / (2*nbGraves));
|
|
||||||
if (data.value > maxEnd ) data.value = maxEnd;
|
|
||||||
if ( nbCritiques > 0 && data.value > 1) data.value = 1;
|
|
||||||
|
|
||||||
if (lastValue - data.value > 1) this.testSiSonne(sante, data); // Peut-être sonné si 2 points d'endurance perdus d'un coup
|
|
||||||
}
|
}
|
||||||
|
data.value = newValue;
|
||||||
//console.log(name, inc, data.value);
|
//console.log(name, inc, data.value);
|
||||||
|
if ( sante.fatigue) { // If endurance lost, then the same amount of fatigue cannot be recovered
|
||||||
let diffEndurance = sante.endurance.max - this.data.data.sante.endurance.value;
|
sante.fatigue.value = Math.max(sante.fatigue.value, this._computeFatigueMin());
|
||||||
if ( sante.fatigue && sante.fatigue.value < diffEndurance) // If endurance lost, then the same amount of fatigue cannot be recovered
|
}
|
||||||
sante.fatigue.value = diffEndurance;
|
|
||||||
//console.log("SANTE::::", sante);
|
//console.log("SANTE::::", sante);
|
||||||
|
|
||||||
await this.update( {"data.sante": sante } );
|
await this.update( {"data.sante": sante } );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_computeFatigueMin() {
|
||||||
|
return this.data.data.sante.endurance.max - this.data.data.sante.endurance.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
_computeEnduranceMax() {
|
||||||
|
let blessures = this.data.data.blessures;
|
||||||
|
let diffVie = this.data.data.sante.vie.max - this.data.data.sante.vie.value;
|
||||||
|
let maxEndVie = this.data.data.sante.endurance.max - (diffVie * 2);
|
||||||
|
let nbGraves = this.GetNumberBlessures(blessures.graves.liste);
|
||||||
|
let nbCritiques = this.GetNumberBlessures(blessures.critiques.liste);
|
||||||
|
let maxEndGraves = Math.floor(this.data.data.sante.endurance.max / (2 * nbGraves));
|
||||||
|
let maxEndCritiques = nbCritiques > 0 ? 1 : this.data.data.sante.endurance.max;
|
||||||
|
return Math.max(0, Math.min(maxEndVie, maxEndGraves, maxEndCritiques));
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async manageBlessureFromSheet( bType, index, active ) {
|
async manageBlessureFromSheet( bType, index, active ) {
|
||||||
let bList = duplicate(this.data.data.blessures);
|
let bList = duplicate(this.data.data.blessures);
|
||||||
|
@ -225,6 +225,12 @@
|
|||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.button-img {
|
||||||
|
width: 8%;
|
||||||
|
height: 8%;
|
||||||
|
border-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.foundryvtt-reve-de-dragon .sheet-header .header-fields {
|
.foundryvtt-reve-de-dragon .sheet-header .header-fields {
|
||||||
-webkit-box-flex: 1;
|
-webkit-box-flex: 1;
|
||||||
-ms-flex: 1;
|
-ms-flex: 1;
|
||||||
@ -348,8 +354,8 @@
|
|||||||
/* ======================================== */
|
/* ======================================== */
|
||||||
/* Sheet */
|
/* Sheet */
|
||||||
|
|
||||||
.sheet header.sheet-header .flex-group-center.flex-hp, .sheet header.sheet-header .flex-group-center.flex-fatigue {font-family: "GrenzeGotisch-Regular";}
|
.sheet header.sheet-header .flex-group-center.flex-compteurs, .sheet header.sheet-header .flex-group-center.flex-actions-bar {font-family: "GrenzeGotisch-Regular";}
|
||||||
.sheet header.sheet-header .flex-hp {text-align: right;}
|
.sheet header.sheet-header .flex-compteurs {text-align: right;}
|
||||||
.sheet header.sheet-header .resource-content {width: 3rem;}
|
.sheet header.sheet-header .resource-content {width: 3rem;}
|
||||||
|
|
||||||
.window-app.sheet .window-content .sheet-header{
|
.window-app.sheet .window-content .sheet-header{
|
||||||
@ -365,16 +371,6 @@
|
|||||||
background: #f5f4f1 url("img/bg_left.jpg") no-repeat left top;
|
background: #f5f4f1 url("img/bg_left.jpg") no-repeat left top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sheet header.sheet-header img {
|
|
||||||
flex: 0 0 64px;
|
|
||||||
height: 64px;
|
|
||||||
width: 64px;
|
|
||||||
object-fit: cover;
|
|
||||||
object-position: 50% 0;
|
|
||||||
margin: 0.5rem;
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
section.sheet-body{padding: 0.25rem 0.5rem;}
|
section.sheet-body{padding: 0.25rem 0.5rem;}
|
||||||
|
|
||||||
.sheet nav.sheet-tabs {
|
.sheet nav.sheet-tabs {
|
||||||
@ -556,7 +552,7 @@ button {
|
|||||||
.table-fatigue .fatigue-malus {
|
.table-fatigue .fatigue-malus {
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
}
|
}
|
||||||
.flex-fatigue {
|
.flex-actions-bar {
|
||||||
flex-grow: 2;
|
flex-grow: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -883,6 +879,7 @@ background: rgba(0, 0, 0, 0.5);
|
|||||||
.tooltip .tooltiptext {
|
.tooltip .tooltiptext {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
width: 360px;
|
width: 360px;
|
||||||
|
background-color: rgba(0,0,0,0.9);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 5px 0;
|
padding: 5px 0;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
@ -890,7 +887,8 @@ background: rgba(0, 0, 0, 0.5);
|
|||||||
/* Position the tooltip text */
|
/* Position the tooltip text */
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
left: -100%;
|
top: 30px;
|
||||||
|
left: -30%;
|
||||||
|
|
||||||
/* Fade in tooltip */
|
/* Fade in tooltip */
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
@ -2,48 +2,69 @@
|
|||||||
|
|
||||||
{{!-- Sheet Header --}}
|
{{!-- Sheet Header --}}
|
||||||
<header class="sheet-header">
|
<header class="sheet-header">
|
||||||
<div class="header-fields">
|
<div class="header-fields">
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
<img class="profile-img" src="{{actor.img}}" data-edit="img" title="{{actor.name}}" />
|
<img class="profile-img" src="{{actor.img}}" data-edit="img" title="{{actor.name}}" />
|
||||||
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="Name"/></h1>
|
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="Name"/></h1>
|
||||||
</div>
|
|
||||||
<div class="flexrow">
|
|
||||||
<div class="flex-group-center flex-hp">
|
|
||||||
<div>
|
|
||||||
<span>Vie <a id="vie-plus">+</a> / <a id="vie-moins">-</a></span>
|
|
||||||
<input class="resource-content" type="text" name="data.sante.vie.value" value="{{data.sante.vie.value}}" data-dtype="Number"/>/{{data.sante.vie.max}}
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span>Endurance <a id="endurance-plus">+</a> / <a id="endurance-moins">-</a></span>
|
|
||||||
<input class="resource-content" type="text" name="data.sante.endurance.value" value="{{data.sante.endurance.value}}" data-dtype="Number"/>/{{data.sante.endurance.max}}
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span>Fatigue <a id="fatigue-plus">+</a> / <a id="fatigue-moins">-</a></span>
|
|
||||||
<input class="resource-content" id="fatigue-value" type="text" name="data.sante.fatigue.value" value="{{data.sante.fatigue.value}}" data-dtype="Number" />/{{data.sante.fatigue.max}}
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span>Sonné :</span>
|
|
||||||
<input class="resource-content" type="checkbox" name="data.sante.sonne.value" value="{{data.sante.sonne.value}}" {{#if data.sante.sonne.value}}checked{{/if}} />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span><span class="ptreve-actuel"><a>Rêve</a></span> <a id="ptreve-actuel-plus">+</a> / <a id="ptreve-actuel-moins">-</a></span>
|
|
||||||
<input class="resource-content" id="pointsreve-value" type="text" name="data.reve.reve.value" value="{{data.reve.reve.value}}" data-dtype="Number" />/{{data.reve.seuil.value}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex-group-center flex-fatigue">
|
|
||||||
<div class="tooltip">Malus de fatigue : {{data.fatigue.malus}}
|
|
||||||
<span class="tooltiptext">{{{data.fatigue.html}}}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flexrow flex-wound">
|
|
||||||
<div class="flexrow">
|
|
||||||
<div class="flex-group-center">Blessures légères : {{data.nbLegeres}}</div>
|
|
||||||
<div class="flex-group-center">Blessures graves : {{data.nbGraves}}</div>
|
|
||||||
<div class="flex-group-center">Blessure critique : {{data.nbCritiques}}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flexrow">
|
||||||
|
<div class="flex-group-center flex-compteurs">
|
||||||
|
<div>
|
||||||
|
<span>Vie <a id="vie-plus">+</a> / <a id="vie-moins">-</a></span>
|
||||||
|
<input class="resource-content" type="text" name="data.sante.vie.value" value="{{data.sante.vie.value}}" data-dtype="Number"/>/{{data.sante.vie.max}}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span>Endurance <a id="endurance-plus">+</a> / <a id="endurance-moins">-</a></span>
|
||||||
|
<input class="resource-content" type="text" name="data.sante.endurance.value" value="{{data.sante.endurance.value}}" data-dtype="Number"/>/{{data.sante.endurance.max}}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="tooltip">Fatigue <a id="fatigue-plus">+</a> / <a id="fatigue-moins">-</a>
|
||||||
|
<span class="tooltiptext">{{{data.fatigue.html}}}</span>
|
||||||
|
</span>
|
||||||
|
<input class="resource-content" id="fatigue-value" type="text" name="data.sante.fatigue.value" value="{{data.sante.fatigue.value}}" data-dtype="Number" />/{{data.sante.fatigue.max}}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span>Sonné :</span>
|
||||||
|
<input class="resource-content" type="checkbox" name="data.sante.sonne.value" value="{{data.sante.sonne.value}}" {{#if data.sante.sonne.value}}checked{{/if}} />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span><span class="ptreve-actuel"><a>Rêve</a></span> <a id="ptreve-actuel-plus">+</a> / <a id="ptreve-actuel-moins">-</a></span>
|
||||||
|
<input class="resource-content" id="pointsreve-value" type="text" name="data.reve.reve.value" value="{{data.reve.reve.value}}" data-dtype="Number" />/{{data.reve.seuil.value}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex-group-center flex-actions-bar">
|
||||||
|
<div>
|
||||||
|
<span class="encaisser-direct"><a title="Encaisser des dommages"><img class="button-img" src="icons/svg/bones.svg" alt="Encaisser des dommages"/></a></span>
|
||||||
|
<span class="dormir-une-heure"><a title="Dormir une heure"><img class="button-img" src="icons/svg/sleep.svg" alt="Dormir une heure"/></a></span>
|
||||||
|
<span class="chateau-dormant"><a title="Chateau Dormant"><img class="button-img" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd12.svg" alt="Chateau Dormant"/></a></span>
|
||||||
|
<span class="monte-tmr"><a title="Montée dans les Terres Medianes !"><img class="button-img" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd08.svg" alt="Montée dans les Terres Medianes !"/></a></span>
|
||||||
|
<span class="monte-tmr-rapide"><a title="Montée accélérée dans les Terres Medianes !"><img class="button-img" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd05.svg" alt="Montée accélérée dans les Terres Medianes !"/></a></span>
|
||||||
|
<span class="visu-tmr"><a title="Regarder les Terres Medianes"><img class="button-img" src="icons/svg/eye.svg" alt="Regarder les Terres Medianes"/></a></span>
|
||||||
|
</div>
|
||||||
|
<div class="flexrow">
|
||||||
|
<span class="tooltip">Malus de fatigue : {{data.fatigue.malus}}
|
||||||
|
<span class="tooltiptext">{{{data.fatigue.html}}}</span>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
{{#if data.nbLegeres}}
|
||||||
|
Blessures: {{data.nbLegeres}} légères
|
||||||
|
{{#if data.nbGraves}}, {{data.nbGraves}} graves{{/if}}
|
||||||
|
{{#if data.nbCritiques}}, une CRITIQUE !{{/if}}
|
||||||
|
{{else}}
|
||||||
|
{{#if data.nbGraves}}
|
||||||
|
Blessures:{{data.nbGraves}} graves
|
||||||
|
{{#if data.nbCritiques}}et une CRITIQUE !{{data.nbCritiques}}{{/if}}
|
||||||
|
{{else}}
|
||||||
|
{{#if data.nbCritiques}}une CRITIQUE !{{data.nbCritiques}}
|
||||||
|
{{else}}Aucune blessure
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
{{!-- Sheet Tab Navigation --}}
|
{{!-- Sheet Tab Navigation --}}
|
||||||
@ -266,9 +287,6 @@
|
|||||||
|
|
||||||
{{!-- Combat Tab --}}
|
{{!-- Combat Tab --}}
|
||||||
<div class="tab combat" data-group="primary" data-tab="combat">
|
<div class="tab combat" data-group="primary" data-tab="combat">
|
||||||
<div>
|
|
||||||
<span class="encaisser-direct"><a>Encaisser des dommages</a></span>
|
|
||||||
</div>
|
|
||||||
<header class="competence-header flexrow">
|
<header class="competence-header flexrow">
|
||||||
<span class="competence-title">Armes</span>
|
<span class="competence-title">Armes</span>
|
||||||
<span class="competence-title">compétence</span>
|
<span class="competence-title">compétence</span>
|
||||||
@ -289,10 +307,6 @@
|
|||||||
|
|
||||||
{{!-- Compteurs/Blessures Tab --}}
|
{{!-- Compteurs/Blessures Tab --}}
|
||||||
<div class="tab blessurescompteurs" data-group="primary" data-tab="blessurescompteurs">
|
<div class="tab blessurescompteurs" data-group="primary" data-tab="blessurescompteurs">
|
||||||
<div class="flex-group-left">
|
|
||||||
<span class="dormir-une-heure"><a title="Dormir une heure"><img src="icons/svg/sleep.svg" alt="Dormir une heure" width="50" height="50"/></a></span>
|
|
||||||
<span class="chateau-dormant"><a title="Chateau Dormant"><img src="systems/foundryvtt-reve-de-dragon/icons/heures/hd12br.png" alt="Chateau Dormant" width="50" height="50"/></a></span>
|
|
||||||
</div>
|
|
||||||
<div class="flex-group-left flexrow">
|
<div class="flex-group-left flexrow">
|
||||||
<ol class="item-list">
|
<ol class="item-list">
|
||||||
{{#each data.compteurs as |compteur key|}}
|
{{#each data.compteurs as |compteur key|}}
|
||||||
@ -412,14 +426,6 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="item flexrow" >
|
|
||||||
<span class="competence-label"></span>
|
|
||||||
<div>
|
|
||||||
<span class="monte-tmr"><a title="Montée dans les Terres Medianes !"><img src="systems/foundryvtt-reve-de-dragon/icons/heures/hd08br.png" alt="Montée dans les Terres Medianes !" width="50" height="50"/></a></span>
|
|
||||||
<span class="monte-tmr-rapide"><a title="Montée accélérée dans les Terres Medianes !"><img src="systems/foundryvtt-reve-de-dragon/icons/heures/hd05br.png" alt="Montée accélérée dans les Terres Medianes !" width="50" height="50"/></a></span>
|
|
||||||
<span class="visu-tmr"><a title="Regarder les Terres Medianes"><img src="icons/svg/eye.svg" alt="Regarder les Terres Medianes" width="50" height="50"/></a></span>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li class="item flexrow">
|
<li class="item flexrow">
|
||||||
<span class="competence-label">Seuil de Rêve :</span>
|
<span class="competence-label">Seuil de Rêve :</span>
|
||||||
<span>
|
<span>
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<div class="flex-group-center">
|
<div class="flex-group-center">
|
||||||
Refoulement : <span id="refoulement-value">0</span>
|
Refoulement : <span id="refoulement-value">0</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-group-center flex-fatigue">
|
<div class="flex-group-center flex-actions-bar">
|
||||||
Fatigue
|
Fatigue
|
||||||
<span id="fatigue-table">{{{fatigue.html}}}</span>
|
<span id="fatigue-table">{{{fatigue.html}}}</span>
|
||||||
</div>
|
</div>
|
||||||
|