Merge branch 'dev_1.1' of gitlab.com:LeRatierBretonnien/foundryvtt-reve-de-dragon into dev_1.1
This commit is contained in:
		
							
								
								
									
										59
									
								
								icons/filter.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								icons/filter.svg
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,59 @@ | ||||
| <?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="12.5243mm" | ||||
|    height="11.2895mm" | ||||
|    viewBox="0 0 71 64" | ||||
|    version="1.1" | ||||
|    id="svg3" | ||||
|    sodipodi:docname="filter.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="1818" | ||||
|      inkscape:window-height="1345" | ||||
|      id="namedview5" | ||||
|      showgrid="false" | ||||
|      inkscape:zoom="13.039316" | ||||
|      inkscape:cx="23.667968" | ||||
|      inkscape:cy="21.334489" | ||||
|      inkscape:window-x="460" | ||||
|      inkscape:window-y="29" | ||||
|      inkscape:window-maximized="1" | ||||
|      inkscape:current-layer="svg3" | ||||
|      inkscape:document-rotation="0" /> | ||||
|   <path | ||||
|      id="Sélection" | ||||
|      fill="none" | ||||
|      stroke="black" | ||||
|      stroke-width="1" | ||||
|      d="M 0,0 C 0,0 71,0 71,0 71,3.03 71.33,7.3 69.98,10 67.09,15.77 46.75,31.08 43.6,36 40.85,40.31 42,56.23 42,62 42,62 29,61 29,61 29,55.3 30.14,40.33 27.4,36 27.4,36 8,16 8,16 5.59,13.59 1.77,10.18 0.6,7 -0.12,5.05 0.01,2.1 0,0 Z m 52,15 c 0,0 -12,1 -12,1 0,0 -18,0 -18,0 1.31,4.38 11.04,15.49 16,13.84 C 42.71,28.26 50.6,19.77 52,15 Z" | ||||
|      style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1" /> | ||||
| </svg> | ||||
| After Width: | Height: | Size: 2.0 KiB | 
							
								
								
									
										60
									
								
								icons/locked.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								icons/locked.svg
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,60 @@ | ||||
| <?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="24" | ||||
|    height="24" | ||||
|    viewBox="0 0 74.999964 74.999964" | ||||
|    version="1.1" | ||||
|    id="svg3" | ||||
|    sodipodi:docname="locked.svg" | ||||
|    inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"> | ||||
|   <metadata | ||||
|      id="metadata9"> | ||||
|     <rdf:RDF> | ||||
|       <cc:Work | ||||
|          rdf:about=""> | ||||
|         <dc:format>image/svg+xml</dc:format> | ||||
|         <dc:type | ||||
|            rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | ||||
|         <dc:title></dc:title> | ||||
|       </cc:Work> | ||||
|     </rdf:RDF> | ||||
|   </metadata> | ||||
|   <defs | ||||
|      id="defs7" /> | ||||
|   <sodipodi:namedview | ||||
|      pagecolor="#ffffff" | ||||
|      bordercolor="#666666" | ||||
|      borderopacity="1" | ||||
|      objecttolerance="10" | ||||
|      gridtolerance="10" | ||||
|      guidetolerance="10" | ||||
|      inkscape:pageopacity="0" | ||||
|      inkscape:pageshadow="2" | ||||
|      inkscape:window-width="3840" | ||||
|      inkscape:window-height="2066" | ||||
|      id="namedview5" | ||||
|      showgrid="false" | ||||
|      inkscape:zoom="11.84917" | ||||
|      inkscape:cx="66.242132" | ||||
|      inkscape:cy="3.3681778" | ||||
|      inkscape:window-x="-11" | ||||
|      inkscape:window-y="-11" | ||||
|      inkscape:window-maximized="1" | ||||
|      inkscape:current-layer="svg3" | ||||
|      inkscape:document-rotation="0" | ||||
|      units="px" /> | ||||
|   <path | ||||
|      id="Sélection #1" | ||||
|      fill="none" | ||||
|      stroke="#000000" | ||||
|      stroke-width="0.43031" | ||||
|      d="m 17.920882,31.968974 c -0.275398,-1.686814 -0.02152,-6.407314 0.253883,-8.175887 1.613662,-10.314528 8.033886,-24.37275369 20.400992,-23.77462269 11.489274,0.5551 17.423247,13.45579069 19.041212,23.34431269 0.309823,1.919182 0.619646,6.773077 0.322733,8.606197 0,0 4.303099,0 4.303099,0 0,0 0,43.030993 0,43.030993 0,0 -49.485638,0 -49.485638,0 0,0 0,-43.030993 0,-43.030993 0,0 5.163719,0 5.163719,0 z m 36.146031,0 c 0,-7.517513 -1.080078,-14.703688 -5.38748,-21.085184 C 46.23097,7.2562774 43.124132,4.5453244 38.575757,4.4334444 26.699204,4.1451364 21.810883,19.614778 21.793671,29.387115 c 0,0 0,2.581859 0,2.581859 0,0 32.273242,0 32.273242,0 z" | ||||
|      style="fill:#000000;fill-opacity:1;stroke:#1a1a1a;stroke-opacity:1;opacity:1" /> | ||||
| </svg> | ||||
| After Width: | Height: | Size: 2.3 KiB | 
							
								
								
									
										63
									
								
								icons/no-filter.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								icons/no-filter.svg
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,63 @@ | ||||
| <?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="12.5243mm" | ||||
|    height="11.2895mm" | ||||
|    viewBox="0 0 71 64" | ||||
|    version="1.1" | ||||
|    id="svg3" | ||||
|    sodipodi:docname="no-filter.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="1818" | ||||
|      inkscape:window-height="1345" | ||||
|      id="namedview5" | ||||
|      showgrid="false" | ||||
|      inkscape:zoom="23.294527" | ||||
|      inkscape:cx="23.667968" | ||||
|      inkscape:cy="14.465922" | ||||
|      inkscape:window-x="630" | ||||
|      inkscape:window-y="276" | ||||
|      inkscape:window-maximized="1" | ||||
|      inkscape:current-layer="svg3" | ||||
|      inkscape:document-rotation="0" /> | ||||
|   <path | ||||
|      id="Sélection" | ||||
|      fill="none" | ||||
|      stroke="black" | ||||
|      stroke-width="1" | ||||
|      d="M 0.00,0.00            C 0.00,0.00 71.00,0.00 71.00,0.00              71.00,3.03 71.33,7.30 69.98,10.00              67.09,15.77 46.75,31.08 43.60,36.00              40.85,40.31 42.00,56.23 42.00,62.00              42.00,62.00 29.00,61.00 29.00,61.00              29.00,55.30 30.14,40.33 27.40,36.00              27.40,36.00 8.00,16.00 8.00,16.00              5.59,13.59 1.77,10.18 0.60,7.00              -0.12,5.05 0.01,2.10 0.00,0.00 Z            M 52.00,15.00            C 52.00,15.00 40.00,16.00 40.00,16.00              40.00,16.00 22.00,16.00 22.00,16.00              23.31,20.38 33.04,31.49 38.00,29.84              42.71,28.26 50.60,19.77 52.00,15.00 Z" | ||||
|      style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1" /> | ||||
|   <path | ||||
|      style="fill:#6c0000;stroke:#6c0000;stroke-width:1.49992px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.5;fill-opacity:1" | ||||
|      d="M 47.004186,-2.0604574 10.753012,51.897773 14.551981,55.052848 56.920138,-6.3101511 52.090941,-8.4993871 Z" | ||||
|      id="path834" /> | ||||
| </svg> | ||||
| After Width: | Height: | Size: 2.6 KiB | 
							
								
								
									
										64
									
								
								icons/unlocked.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								icons/unlocked.svg
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,64 @@ | ||||
| <?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="26.240078" | ||||
|    height="24.137722" | ||||
|    viewBox="0 0 82.000206 75.430344" | ||||
|    version="1.1" | ||||
|    id="svg3" | ||||
|    sodipodi:docname="unlocked.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="1818" | ||||
|      inkscape:window-height="1345" | ||||
|      id="namedview5" | ||||
|      showgrid="false" | ||||
|      inkscape:zoom="9.407583" | ||||
|      inkscape:cx="32.22484" | ||||
|      inkscape:cy="24.325892" | ||||
|      inkscape:window-x="630" | ||||
|      inkscape:window-y="276" | ||||
|      inkscape:window-maximized="1" | ||||
|      inkscape:current-layer="svg3" | ||||
|      inkscape:document-rotation="0" | ||||
|      units="px" | ||||
|      fit-margin-top="0" | ||||
|      fit-margin-left="0" | ||||
|      fit-margin-right="0" | ||||
|      fit-margin-bottom="0" /> | ||||
|   <path | ||||
|      id="Sélection #1" | ||||
|      fill="none" | ||||
|      stroke="#000000" | ||||
|      stroke-width="0.430321" | ||||
|      d="m 41.525985,32.183078 c -0.757365,-3.180073 0.619662,-10.938762 1.600794,-14.200596 1.097319,-3.636213 2.990736,-7.836147 5.422046,-10.7580268 1.36842,-1.639523 3.63191,-3.85998 5.45647,-4.957299 2.39689,-1.44587897 5.38332,-2.17312097 8.1761,-2.03541897 9.56174,0.460444 15.50017,9.83713977 17.88845,18.18106577 1.04138,3.636213 1.32539,5.723271 1.4717,9.467064 0.0645,0.933797 0.50347,2.891758 0,3.614697 -0.667,0.890765 -2.86164,0.688514 -3.86859,0.688514 0,-7.620987 -1.35551,-15.23767 -5.99007,-21.516054 -2.30652,-3.1198278 -5.46077,-5.8308508 -9.50149,-6.0072828 -4.9573,-0.21516 -8.35253,2.543198 -11.09798,6.4376038 -4.39788,6.239655 -5.684541,13.615359 -5.684541,21.085733 0,0 4.303211,0 4.303211,0 0,0 0,43.032105 0,43.032105 0,0 -49.4869245,0 -49.4869245,0 0,0 0,-43.032105 0,-43.032105 0,0 41.3108245,0 41.3108245,0 z" | ||||
|      style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:0.5" /> | ||||
| </svg> | ||||
| After Width: | Height: | Size: 2.6 KiB | 
| @@ -32,9 +32,11 @@ export class RdDActorSheet extends ActorSheet { | ||||
|     // Gestion du lock/unlock des zones éditables (carac+compétences) | ||||
|     data.data.editCaracComp  = this.options.editCaracComp; | ||||
|     data.data.lockUnlockText = (this.options.editCaracComp) ? "Bloquer" : "Débloquer"; | ||||
|     data.data.lockUnlockIcon = (this.options.editCaracComp) ? "unlocked.svg" : "locked.svg"; | ||||
|     // Gestion de l'affichage total/partiel des compétences | ||||
|     data.data.cacherCompetencesNiveauBase  = this.options.cacherCompetencesNiveauBase; | ||||
|     data.data.showHideCompetenceText = (this.options.cacherCompetencesNiveauBase) ? "Montrer tout" : "Filtrer" ; | ||||
|     data.data.showHideCompetenceIcon = (this.options.cacherCompetencesNiveauBase) ? "no-filter.svg" : "filter.svg"; | ||||
|      | ||||
|     let compCategorieNiveau = RdDUtility.getLevelCategory(); // recup catégorie | ||||
|     data.itemsByType = RdDUtility.buildItemsClassification(data.items); | ||||
|   | ||||
| @@ -126,9 +126,11 @@ export class RdDActor extends Actor { | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   getBonusDegat() { | ||||
|     return parseInt(this.data.data.attributs.plusdom.value); | ||||
|     return Misc.toInt(this.data.data.attributs.plusdom.value); | ||||
|   } | ||||
|   getProtectionNaturelle() { | ||||
|     return Misc.toInt(this.data.data.attributs.protection.value); | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   getCompetence(compName) { | ||||
|     return RdDUtility.findCompetence(this.data.items, compName); | ||||
| @@ -202,32 +204,34 @@ export class RdDActor extends Actor { | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   computeDeteriorationArme( rollData ) { | ||||
|     if ( rollData.arme && rollData.attackerRoll) { // C'est une parade | ||||
|   async computeDeteriorationArme( rollData ) { | ||||
|     const attackerRoll = rollData.attackerRoll; | ||||
|     if (rollData.arme && attackerRoll) { // C'est une parade | ||||
|       // Est-ce que l'attaque est une particulière, en force ou charge et que l'attaque n'en est pas une ? | ||||
|       if ( rollData.attackerRoll.rolled.isPart  | ||||
|             && ( (rollData.attackerRoll.particuliereAttaque && rollData.attackerRoll.particuliereAttaque == 'force') || rollData.attackerRoll.isCharge) | ||||
|             && !rollData.rolled.isPart ) { | ||||
|         // Jet de résistance de l'arme de parade (p.132) | ||||
|         let resist = RdDResolutionTable.roll( rollData.arme.data.resistance, rollData.attackerRoll.domArmePlusDom ); | ||||
|       if ( (rollData.needResist || attackerRoll.particuliereAttaque == 'force' || attackerRoll.isCharge) | ||||
|       && !rollData.rolled.isPart ) { | ||||
|         const dmg = attackerRoll.dmg.dmgArme + attackerRoll.dmg.dmgActor; | ||||
|         let resistance = Misc.toInt(rollData.arme.data.resistance); | ||||
|         let msg = ""; | ||||
|         if (resist.isSuccess) { // Perte de résistance | ||||
|           msg = "Jet de résistance de votre arme réussit !" | ||||
|         // Jet de résistance de l'arme de parade (p.132) | ||||
|         let resistRoll = await RdDResolutionTable.roll( resistance, - dmg ); | ||||
|         if (resistRoll.isSuccess) { // Perte de résistance | ||||
|           msg = "Votre " + rollData.arme.name + " tient le choc de la parade. " | ||||
|         } else { | ||||
|           rollData.arme.data.resistance -=  rollData.attackerRoll.domArmePlusDom; | ||||
|           if ( rollData.arme.data.resistance <= 0 ) { | ||||
|           resistance -= dmg; | ||||
|           if ( resistance <= 0 ) { | ||||
|             this.deleteEmbeddedEntity("OwnedItem", rollData.arme._id); | ||||
|             msg = "Votre arme s'est brisée sous le coup de la parade : " + rollData.arme.name; | ||||
|             msg = "Sous la violence de la parade, votre " + rollData.arme.name + " s'est brisée sous le coup!"; | ||||
|           } else { | ||||
|             this.updateEmbeddedEntity("OwnedItem", {_id: rollData.arme._id, 'data.resistance': rollData.arme.data.resistance });  | ||||
|             msg = "Votre arme a perdu de la résistance : " + rollData.arme.name + " - " + rollData.arme.data.resistance; | ||||
|             this.updateEmbeddedEntity("OwnedItem", {_id: rollData.arme._id, 'data.resistance': resistance });  | ||||
|             msg = "En parant, vous endommagez votre " + rollData.arme.name + ", qui perd  " + dmg + " de résistance. "; | ||||
|           } | ||||
|         } | ||||
|         // Jet de désarmement | ||||
|         if ( !rollData.arme.includes('Bouclier') ) { // Si l'arme de parade n'est pas un bouclier, jet de désarmement (p.132) | ||||
|           let desarme = RdDResolutionTable.roll( this.data.data.carac.force.value, Number(rollData.competence.data.niveau) + Number(rollData.attackerRoll.domArmePlusDom) ); | ||||
|           if ( !desarme.isSucess) { | ||||
|             msg += "<br>De plus, vous êtes désarmé ! Votre arme " + rollData.arme.name + "tombe au sol à vos pieds"; | ||||
|         if (resistance > 0 && !rollData.arme.name.toLowerCase().includes('bouclier') ) { // Si l'arme de parade n'est pas un bouclier, jet de désarmement (p.132) | ||||
|           let desarme = await RdDResolutionTable.roll( this.data.data.carac.force.value, Misc.toInt(rollData.competence.data.niveau) -dmg ); | ||||
|           if ( desarme.isEchec) { | ||||
|             msg += "Vous ne parvenez pas à garder votre arme en main, elle tombe au sol à vos pieds"; | ||||
|           } | ||||
|         } | ||||
|         ChatMessage.create( { content: msg, | ||||
| @@ -245,13 +249,13 @@ export class RdDActor extends Actor { | ||||
|         let recul = await RdDResolutionTable.roll( 10, reculNiveau ); | ||||
|         let msg = ""; | ||||
|         if (recul.isSuccess) { | ||||
|           msg = this.data.name + " - Jet de Recul réussi, aucun effet !"; | ||||
|           msg = " Vous ne reculez pas malgré la force du coup."; | ||||
|         } else { | ||||
|           let chute = await RdDResolutionTable.roll( this.data.data.carac.agilite.value, reculNiveau ); | ||||
|           if ( !chute.isSuccess || recul.isETotal ) { | ||||
|             msg = this.data.name + " - Jet de Recul : Vous subissez le recul du coup, et vous chutez au sol ! Vous ne pouvez plus attaquer ce round."; | ||||
|             msg = "Sous la violence du coup, vous reculez et chutez au sol ! Vous ne pouvez plus attaquer ce round."; | ||||
|           } else { | ||||
|             msg = this.data.name + " - Jet de Recul : Vous subissez le recul du coup, et vous reculez de quelques mètres ! Vous ne pouvez plus attaquer ce round."; | ||||
|             msg = "La violence du choc vous fait reculer de quelques mètres ! Vous ne pouvez plus attaquer ce round."; | ||||
|           } | ||||
|         }   | ||||
|         ChatMessage.create( {content: msg,  | ||||
| @@ -280,7 +284,7 @@ export class RdDActor extends Actor { | ||||
|        // In case of fight, replace the message per dommages + localization. it indicates if result is OK or not | ||||
|       if (rollData.attackerRoll) { // Defense case ! | ||||
|         if (rolled.isSign || (!rollData.needSignificative && rolled.isSuccess)) { | ||||
|           this.computeDeteriorationArme( rollData ); | ||||
|           await this.computeDeteriorationArme( rollData ); | ||||
|           explications += "<br><strong>Attaque parée/esquivée !</strong>"; | ||||
|         } else  { | ||||
|           explications += "<br><strong>Esquive/Parade échouée, encaissement !</strong>"; | ||||
| @@ -1882,15 +1886,18 @@ export class RdDActor extends Actor { | ||||
|   } | ||||
|    | ||||
|   /* -------------------------------------------- */   | ||||
|   computeArmure( locData, domArmePlusDom, arme = undefined ) { | ||||
|   computeArmure( attackerRoll ) { | ||||
|     let locData = attackerRoll.loc; | ||||
|     let dmg = attackerRoll.dmg.dmgArme + attackerRoll.dmg.dmgActor; | ||||
|     let arme =  attackerRoll.arme; | ||||
|     // TODO: arc ignore armure | ||||
|     let protection = 0; | ||||
|     for (const item of this.data.items) { | ||||
|       if (item.type == "armure" && item.data.equipe) { | ||||
|         let update = duplicate(item); | ||||
|         protection += new Roll(update.data.protection.toString()).roll().total; | ||||
|         update.data.deterioration += domArmePlusDom; | ||||
|         domArmePlusDom = 0; // Reset it | ||||
|         update.data.deterioration = Misc.toInt(update.data.deterioration) + dmg; | ||||
|         dmg = 0; // Reset it | ||||
|         if ( update.data.deterioration >= 10) {           | ||||
|           update.data.deterioration = 0; | ||||
|           if ( update.data.protection.toString().length == 1 )  | ||||
| @@ -1905,6 +1912,7 @@ export class RdDActor extends Actor { | ||||
|         this.updateEmbeddedEntity("OwnedItem", update);  | ||||
|       } | ||||
|     } | ||||
|     protection += this.getProtectionNaturelle(); | ||||
|     console.log("Final protect", protection); | ||||
|     return protection; | ||||
|   } | ||||
| @@ -1916,7 +1924,7 @@ export class RdDActor extends Actor { | ||||
|     } | ||||
|  | ||||
|     console.log("encaisserDommages", attackerRoll ) | ||||
|     const armure = this.computeArmure( attackerRoll.loc, attackerRoll.domArmePlusDom, attackerRoll.arme); | ||||
|     const armure = this.computeArmure( attackerRoll ); | ||||
|  | ||||
|     const rollEncaissement = new Roll("2d10 + @dmg - @armure",{ | ||||
|       dmg: attackerRoll.dmg.total, | ||||
|   | ||||
| @@ -74,6 +74,10 @@ export class RdDCombat { | ||||
|       return; | ||||
|     } | ||||
|     let rollData = game.system.rdd.rollDataHandler[this.attackerId]; | ||||
|     if (!rollData) { | ||||
|       ui.notifications.warn("Action automatisée impossible, le jet de l'attaquant a été perdu (suite à un raffraichissement?)") | ||||
|       return; | ||||
|     } | ||||
|     // TODO: enlever le ChatMessage? | ||||
|     switch (button) { | ||||
|       case '#particuliere-attaque': return await this.choixParticuliere(rollData, event.currentTarget.attributes['data-mode'].value); | ||||
| @@ -364,10 +368,7 @@ export class RdDCombat { | ||||
|   /* -------------------------------------------- */ | ||||
|   async _onParadeNormale(rollData) { | ||||
|     console.log("RdDCombat._onParadeNormale >>>", rollData); | ||||
|     if (rollData.needResist && !rollData.rolled.isPart) { | ||||
|       // TODO: déplacer la logique détérioration armure dans RdDCombat | ||||
|       this.defender.computeDeteriorationArme(rollData); | ||||
|     } | ||||
|     await this.defender.computeDeteriorationArme(rollData); | ||||
|     await this.defender.computeRecul(rollData, false); | ||||
|  | ||||
|     let chatOptions = { | ||||
|   | ||||
| @@ -238,6 +238,19 @@ table {border: 1px solid #7a7971;} | ||||
|   height: 8%; | ||||
|   border-width: 0; | ||||
| } | ||||
| .small-button-container { | ||||
|   height: 16px; | ||||
|   border: 0; | ||||
| } | ||||
|  | ||||
| .small-button-container img { | ||||
|   max-height: 100%; | ||||
|   max-width: 100%; | ||||
| } | ||||
| .small-button-img { | ||||
|   max-height: 24; | ||||
|   border-width: 0; | ||||
| } | ||||
|  | ||||
| .foundryvtt-reve-de-dragon .sheet-header .header-fields { | ||||
|   -webkit-box-flex: 1; | ||||
|   | ||||
| @@ -5,7 +5,7 @@ | ||||
|   "version": "1.1.10", | ||||
|   "minimumCoreVersion": "0.7.5", | ||||
|   "compatibleCoreVersion": "0.7.8", | ||||
|   "templateVersion": 69, | ||||
|   "templateVersion": 70, | ||||
|   "author": "LeRatierBretonnien", | ||||
|   "esmodules": [ "module/rdd-main.js", "module/hook-renderChatLog.js" ], | ||||
|   "styles": ["styles/simple.css"], | ||||
|   | ||||
| @@ -49,7 +49,7 @@ | ||||
|           "max": 10, | ||||
|           "value": 10, | ||||
|           "label": "Endurance", | ||||
|           "derivee": false             | ||||
|           "derivee": false | ||||
|         }, | ||||
|         "resonnance": { | ||||
|           "actors" : [] | ||||
| @@ -77,6 +77,12 @@ | ||||
|           "value": 0, | ||||
|           "label": "Vitesse", | ||||
|           "derivee": true             | ||||
|         }, | ||||
|         "protection": { | ||||
|           "type": "number", | ||||
|           "value": 0, | ||||
|           "label": "Protection", | ||||
|           "derivee": false | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
| @@ -138,7 +144,7 @@ | ||||
|           "max": 10, | ||||
|           "value": 10, | ||||
|           "label": "Endurance", | ||||
|           "derivee": false             | ||||
|           "derivee": false | ||||
|         }, | ||||
|         "sonne": { | ||||
|           "value": false, | ||||
| @@ -178,13 +184,13 @@ | ||||
|           "type": "number", | ||||
|           "value": 0, | ||||
|           "label": "Encombrement", | ||||
|           "derivee": false             | ||||
|           "derivee": false | ||||
|         }, | ||||
|         "protection": { | ||||
|           "type": "number", | ||||
|           "value": 0, | ||||
|           "label": "Protection", | ||||
|           "derivee": false             | ||||
|           "derivee": false | ||||
|         } | ||||
|       }, | ||||
|       "compteurs": { | ||||
| @@ -240,7 +246,7 @@ | ||||
|           "value": 10, | ||||
|           "label": "Dexterité", | ||||
|           "xp": 0, | ||||
|           "derivee": false             | ||||
|           "derivee": false | ||||
|         }, | ||||
|         "vue": { | ||||
|           "type": "number", | ||||
| @@ -261,7 +267,7 @@ | ||||
|           "value": 10, | ||||
|           "label": "Odorat-Goût", | ||||
|           "xp": 0, | ||||
|           "derivee": false             | ||||
|           "derivee": false | ||||
|         }, | ||||
|         "volonte": { | ||||
|           "type": "number", | ||||
| @@ -275,14 +281,14 @@ | ||||
|           "value": 10, | ||||
|           "label": "Intellect", | ||||
|           "xp": 0, | ||||
|           "derivee": false             | ||||
|           "derivee": false | ||||
|         }, | ||||
|         "empathie": { | ||||
|           "type": "number", | ||||
|           "value": 10, | ||||
|           "label": "Empathie", | ||||
|           "xp": 0, | ||||
|           "derivee": false             | ||||
|           "derivee": false | ||||
|         }, | ||||
|         "reve": { | ||||
|           "type": "number", | ||||
| @@ -400,6 +406,12 @@ | ||||
|           "value": 0, | ||||
|           "label": "Malus Armure", | ||||
|           "derivee": true             | ||||
|         }, | ||||
|         "protection": { | ||||
|           "type": "number", | ||||
|           "value": 0, | ||||
|           "label": "Protection naturelle", | ||||
|           "derivee": false | ||||
|         } | ||||
|       }, | ||||
|       "reve": { | ||||
|   | ||||
| @@ -98,7 +98,7 @@ | ||||
|         <div class="tab items" data-group="primary" data-tab="carac"> | ||||
|           <div class="grid grid-2col"> | ||||
|             <div class="flex-group-left flexcol"> | ||||
|               <span><a class="lock-unlock-sheet">{{data.lockUnlockText}}</a></span> | ||||
|               <span><a class="lock-unlock-sheet"><img class="small-button-container" src="systems/foundryvtt-reve-de-dragon/icons/{{data.lockUnlockIcon}}" alt="blocker/débloquer">{{data.lockUnlockText}}</a></span> | ||||
|               <ul class="carac-list alterne-list"> | ||||
|                 {{#each data.carac as |carac key|}} | ||||
|                     <li class="competence flexrow list-item" data-attribute="{{key}}"> | ||||
| @@ -162,8 +162,8 @@ | ||||
|         {{!-- Compétences Tab --}} | ||||
|         <div class="tab competences" data-group="primary" data-tab="competences"> | ||||
|           <div class="flexrow"> | ||||
|             <span><a class="lock-unlock-sheet">{{data.lockUnlockText}}</a></span> | ||||
|             <span><a class="show-hide-competences">{{data.showHideCompetenceText}}</a></span>  | ||||
|             <span><a class="lock-unlock-sheet"><img class="small-button-container" src="systems/foundryvtt-reve-de-dragon/icons/{{data.lockUnlockIcon}}" alt="blocker/débloquer">{{data.lockUnlockText}}</a></span> | ||||
|             <span><a class="show-hide-competences"><img class="small-button-container" src="systems/foundryvtt-reve-de-dragon/icons/{{data.showHideCompetenceIcon}}" alt="filter/montrer tout">{{data.showHideCompetenceText}}</a></span>  | ||||
|           </div> | ||||
|           <div class="grid grid-2col"> | ||||
|             <div class="flex-group-left flexcol competence-column"> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user