L'état général ne s'applique pas toujours
- jets de chance - jets de résistance (Rêve Actuel) - jets de stress (ne passe pas par la fenêtre de résolution) RdD Page 93
This commit is contained in:
		| @@ -71,7 +71,13 @@ export class RdDRollDialog extends Dialog { | |||||||
|  |  | ||||||
|       rollData.finalLevel = rollLevel; |       rollData.finalLevel = rollLevel; | ||||||
|       rollData.caracValue = caracValue |       rollData.caracValue = caracValue | ||||||
|        |  | ||||||
|  |       if (RdDRollDialog._isEtatGeneralApplicable(rollData)) { | ||||||
|  |         $(".etat-general").show(); | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         $(".etat-general").hide(); | ||||||
|  |       } | ||||||
|       // Sort management |       // Sort management | ||||||
|       if ( rollData.selectedSort ) { |       if ( rollData.selectedSort ) { | ||||||
|         //console.log("Toggle show/hide", rollData.selectedSort); |         //console.log("Toggle show/hide", rollData.selectedSort); | ||||||
| @@ -167,9 +173,16 @@ export class RdDRollDialog extends Dialog { | |||||||
|     });           |     });           | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   static _isEtatGeneralApplicable(rollData) { | ||||||
|  |     if (rollData.selectedCarac.label == 'Chance') return false; | ||||||
|  |     if (rollData.selectedCarac.label == 'Rêve Actuel') return false; | ||||||
|  |      | ||||||
|  |     return true; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   static _computeFinalLevel(rollData) { |   static _computeFinalLevel(rollData) { | ||||||
|     const etat = Misc.toInt(rollData.etat); |     const etat = RdDRollDialog._isEtatGeneralApplicable(rollData) ? Misc.toInt(rollData.etat) : 0; | ||||||
|     const diffConditions = Misc.toInt(rollData.diffConditions); |     const diffConditions = Misc.toInt(rollData.diffConditions); | ||||||
|     let malusEnc  = (rollData.surencMalusApply ) ? rollData.surencMalusValue : 0; |     let malusEnc  = (rollData.surencMalusApply ) ? rollData.surencMalusValue : 0; | ||||||
|     let diffLibre = Misc.toInt(rollData.diffLibre); |     let diffLibre = Misc.toInt(rollData.diffLibre); | ||||||
|   | |||||||
| @@ -45,7 +45,7 @@ | |||||||
| {{/if}} | {{/if}} | ||||||
| {{>"systems/foundryvtt-reve-de-dragon/templates/dialog-roll-surenc.html"}} | {{>"systems/foundryvtt-reve-de-dragon/templates/dialog-roll-surenc.html"}} | ||||||
| {{>"systems/foundryvtt-reve-de-dragon/templates/dialog-roll-natation.html"}} | {{>"systems/foundryvtt-reve-de-dragon/templates/dialog-roll-natation.html"}} | ||||||
| <div class="form-group"> | <div class="form-group etat-general"> | ||||||
|   <label for="categorie">Etat général</label><label>{{numberFormat etat decimals=0 sign=true}}</label> |   <label for="categorie">Etat général</label><label>{{numberFormat etat decimals=0 sign=true}}</label> | ||||||
| </div> | </div> | ||||||
| <div class="form-group"> | <div class="form-group"> | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ | |||||||
|   </select> |   </select> | ||||||
| </div> | </div> | ||||||
| {{>"systems/foundryvtt-reve-de-dragon/templates/dialog-roll-surenc.html"}} | {{>"systems/foundryvtt-reve-de-dragon/templates/dialog-roll-surenc.html"}} | ||||||
| <div class="form-group"> | <div class="form-group etat-general"> | ||||||
|   <label for="categorie">Etat général</label><label>{{numberFormat etat decimals=0 sign=true}}</label> |   <label for="categorie">Etat général</label><label>{{numberFormat etat decimals=0 sign=true}}</label> | ||||||
| </div> | </div> | ||||||
| <div class="form-group"> | <div class="form-group"> | ||||||
|   | |||||||
| @@ -59,7 +59,7 @@ | |||||||
|   </select> |   </select> | ||||||
| </div> | </div> | ||||||
|  |  | ||||||
| <div class="form-group"> | <div class="form-group etat-general"> | ||||||
|   <label for="categorie">Etat général</label><label>{{numberFormat etat decimals=0 sign=true}}</label> |   <label for="categorie">Etat général</label><label>{{numberFormat etat decimals=0 sign=true}}</label> | ||||||
| </div> | </div> | ||||||
| <div class="form-group"> | <div class="form-group"> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user