Merge branch 'fixes-1.2' into 'master'

Fixes 1.2

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!126
This commit is contained in:
Leratier Bretonnien 2021-01-22 22:35:31 +00:00
commit 58151e5483
3 changed files with 18 additions and 16 deletions

View File

@ -90,16 +90,11 @@ export class RdDActorSheet extends ActorSheet {
data.data.combat = duplicate(RdDUtility.checkNull(data.itemsByType['arme'])); data.data.combat = duplicate(RdDUtility.checkNull(data.itemsByType['arme']));
data.data.combat = RdDUtility._finalizeArmeList(data.data.combat, data.itemsByType.competence, data.data.carac); data.data.combat = RdDUtility._finalizeArmeList(data.data.combat, data.itemsByType.competence, data.data.carac);
if (data.competenceByCategory && data.competenceByCategory.melee) { data.esquive = { name: "Esquive", niveau: data.competenceByCategory?.melee.find(it => it.name == 'Esquive')?.data.niveau ?? -6};
//Specific case for Esquive and Corps à Corps let corpsACorps = data.competenceByCategory?.melee.find(it => it.name == 'Corps à corps');
for (const melee of data.competenceByCategory.melee) { if (corpsACorps) {
if (melee.name == "Esquive") let cc_init = RdDUtility.calculInitiative(corpsACorps.data.niveau, data.data.carac['melee'].value);
data.data.combat.push({ name: "Esquive", data: { niveau: melee.data.niveau, description: "", force: 6, initiative: "", competence: "Esquive", dommages: 0 } }); data.data.combat.push(RdDItemArme.mainsNues({ niveau: corpsACorps.data.niveau, initiative: cc_init }));
if (melee.name == "Corps à corps") {
let cc_init = RdDUtility.calculInitiative(melee.data.niveau, data.data.carac['melee'].value);
data.data.combat.push(RdDItemArme.mainsNues({ niveau: melee.data.niveau, initiative: cc_init }));
}
}
} }
this.armesList = duplicate(data.data.combat); this.armesList = duplicate(data.data.combat);

View File

@ -215,7 +215,7 @@ export class RdDCommands {
caracValue: carac, caracValue: carac,
finalLevel: diff, finalLevel: diff,
showDice: true, showDice: true,
diviseur: significative ? 2 : 1, diviseurSignificative: significative ? 2 : 1,
show: { title: "Table de résolution" } show: { title: "Table de résolution" }
}; };
await RdDResolutionTable.rollData(rollData); await RdDResolutionTable.rollData(rollData);

View File

@ -529,13 +529,20 @@
</li> </li>
{{#each data.combat as |arme key|}} {{#each data.combat as |arme key|}}
<li class="item flexrow list-item" data-item-id="{{arme._id}}"> <li class="item flexrow list-item" data-item-id="{{arme._id}}">
<span class="arme-label" name="data.armes[{{key}}].name"><a data-competence-name="{{arme.data.competence}}">{{arme.name}}</a></span> <span class="arme-label"><a data-competence-name="{{arme.data.competence}}">{{arme.name}}</a></span>
<span class="arme-initiative" ><a data-arme-name="{{arme.name}}" data-competence-name="{{arme.data.competence}}">{{arme.data.initiative}}</a></span> <span class="arme-initiative"><a data-arme-name="{{arme.name}}" data-competence-name="{{arme.data.competence}}">{{arme.data.initiative}}</a></span>
<span class="competence-label">{{arme.data.competence}}</span> <span class="competence-label">{{arme.data.competence}}</span>
<span class="competence-value" name="data.armes[{{key}}].data.niveau">{{numberFormat arme.data.niveau decimals=0 sign=true}}</span> <span class="competence-value">{{numberFormat arme.data.niveau decimals=0 sign=true}}</span>
<span class="competence-value" name="data.armes[{{key}}].data.dommages">{{numberFormat arme.data.dommages decimals=0 sign=true}}</span> <span class="competence-value">{{numberFormat arme.data.dommages decimals=0 sign=true}}</span>
</li> </li>
{{/each}} {{/each}}
<li class="item flexrow list-item">
<span class="competence-label"><a data-competence-name="{{esquive.name}}">{{esquive.name}}</a></span>
<span class="arme-initiative"></span>
<span class="competence-label"></span>
<span class="competence-value">{{numberFormat esquive.niveau decimals=0 sign=true}}</span>
<span class="competence-value"></span>
</li>
</ul> </ul>
</div> </div>