#11 gestion encombrement et malus associé

This commit is contained in:
sladecraven 2020-11-12 15:06:25 +01:00
parent 3b82817d91
commit 2f438ccd10
4 changed files with 12 additions and 13 deletions

View File

@ -86,15 +86,15 @@ export class RdDActorSheet extends ActorSheet {
} }
// To avoid armour and so on... // To avoid armour and so on...
data.data.armes_seules = duplicate( this._checkNull(data.itemsByType['arme'])); data.data.combat = duplicate( this._checkNull(data.itemsByType['arme']));
if (data.competenceByCategory && data.competenceByCategory.melee) { if (data.competenceByCategory && data.competenceByCategory.melee) {
//Specific case for Esquive and Corps à Corps //Specific case for Esquive and Corps à Corps
for ( const melee of data.competenceByCategory.melee ) { for ( const melee of data.competenceByCategory.melee ) {
if (melee.name == "Esquive") if (melee.name == "Esquive")
data.itemsByType.arme.push( { name: "Esquive", data: { niveau: melee.data.niveau, description: "", force: 6, competence: "Esquive", dommages: 0} } ); data.data.combat.push( { name: "Esquive", data: { niveau: melee.data.niveau, description: "", force: 6, competence: "Esquive", dommages: 0} } );
if (melee.name == "Corps à corps") if (melee.name == "Corps à corps")
data.itemsByType.arme.push( { name: "Corps à corps", data: { niveau: melee.data.niveau, description: "", force: 6, competence: "Corps à corps", dommages: data.data.attributs.plusdom.value } } ); data.data.combat.push( { name: "Corps à corps", data: { niveau: melee.data.niveau, description: "", force: 6, competence: "Corps à corps", dommages: data.data.attributs.plusdom.value } } );
} }
} }

View File

@ -164,10 +164,11 @@ export class RdDUtility {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
/** Construit la structure récursive des conteneurs, avec imbrication potentielle
*
*/
static buildConteneur( objet, niveau ) { static buildConteneur( objet, niveau ) {
if (!niveau) niveau = 1; if (!niveau) niveau = 1;
let prefix = "";
for (let i = 0; i < niveau; i++) prefix += "&nbsp;";
let str = Handlebars.partials['systems/foundryvtt-reve-de-dragon/templates/actor-inventaire-conteneur.html']( { item: objet} ); let str = Handlebars.partials['systems/foundryvtt-reve-de-dragon/templates/actor-inventaire-conteneur.html']( { item: objet} );
if (objet.type == 'conteneur') { if (objet.type == 'conteneur') {
str = str + "<ol class='item-list'>"; str = str + "<ol class='item-list'>";

View File

@ -2,7 +2,7 @@
"name": "foundryvtt-reve-de-dragon", "name": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon", "title": "Rêve de Dragon",
"description": "Rêve de Dragon RPG for FoundryVTT", "description": "Rêve de Dragon RPG for FoundryVTT",
"version": "0.9.32", "version": "0.9.33",
"minimumCoreVersion": "0.7.5", "minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.7.6", "compatibleCoreVersion": "0.7.6",
"templateVersion": 44, "templateVersion": 44,

View File

@ -265,7 +265,7 @@
<span class="competence-title">+dom</span> <span class="competence-title">+dom</span>
</header> </header>
<ol class="item-list"> <ol class="item-list">
{{#each data.armes as |arme key|}} {{#each data.combat as |arme key|}}
<li class="item flexrow" data-item-id="{{arme._id}}"> <li class="item flexrow" data-item-id="{{arme._id}}">
<span class="arme-label" name="data.armes[{{key}}].name"><a>{{arme.name}}</a></span> <span class="arme-label" name="data.armes[{{key}}].name"><a>{{arme.name}}</a></span>
<span class="competence-label" name="data.armes[{{key}}].data.competence">{{arme.data.competence}}</span> <span class="competence-label" name="data.armes[{{key}}].data.competence">{{arme.data.competence}}</span>
@ -421,7 +421,7 @@
{{!-- Equipment Tab --}} {{!-- Equipment Tab --}}
<div class="tab items" data-group="primary" data-tab="items"> <div class="tab items" data-group="primary" data-tab="items">
<span cass=item-name>Encombrement total/max : {{data.encombrementTotal}} / {{data.attributs.encombrement.value}}</span> <span cass=item-name>Encombrement total/max : {{numberFormat data.encombrementTotal decimals=1}} / {{data.attributs.encombrement.value}}</span>
<hr> <hr>
<span cass=item-name>Porté sur soi</span> <span cass=item-name>Porté sur soi</span>
<ol class="item-list"> <ol class="item-list">
@ -440,11 +440,9 @@
{{/if}} {{/if}}
{{/unless}} {{/unless}}
{{/each}} {{/each}}
<ol class="item-list"> {{#each data.conteneurs as |conteneur id|}}
{{#each data.conteneurs as |conteneur id|}} {{buildConteneur this}}
{{buildConteneur this}} {{/each}}
{{/each}}
</ol>
</div> </div>
{{!-- Biography Tab --}} {{!-- Biography Tab --}}