Plus d'attaque avec l'esquive

This commit is contained in:
Vincent Vandemeulebrouck 2021-01-22 23:19:17 +01:00
parent f5deb4e81f
commit d032d9e510
2 changed files with 17 additions and 15 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

@ -529,14 +529,21 @@
</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}}
</ul> <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>
</div> </div>
{{!-- Compteurs/Blessures Tab --}} {{!-- Compteurs/Blessures Tab --}}