Plus d'attaque avec l'esquive
This commit is contained in:
parent
0d3586b3c5
commit
003fa8c43a
@ -90,16 +90,11 @@ export class RdDActorSheet extends ActorSheet {
|
||||
data.data.combat = duplicate(RdDUtility.checkNull(data.itemsByType['arme']));
|
||||
data.data.combat = RdDUtility._finalizeArmeList(data.data.combat, data.itemsByType.competence, data.data.carac);
|
||||
|
||||
if (data.competenceByCategory && data.competenceByCategory.melee) {
|
||||
//Specific case for Esquive and Corps à Corps
|
||||
for (const melee of data.competenceByCategory.melee) {
|
||||
if (melee.name == "Esquive")
|
||||
data.data.combat.push({ name: "Esquive", data: { niveau: melee.data.niveau, description: "", force: 6, initiative: "", competence: "Esquive", dommages: 0 } });
|
||||
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 }));
|
||||
}
|
||||
}
|
||||
data.esquive = { name: "Esquive", niveau: data.competenceByCategory?.melee.find(it => it.name == 'Esquive')?.data.niveau ?? -6};
|
||||
let corpsACorps = data.competenceByCategory?.melee.find(it => it.name == 'Corps à corps');
|
||||
if (corpsACorps) {
|
||||
let cc_init = RdDUtility.calculInitiative(corpsACorps.data.niveau, data.data.carac['melee'].value);
|
||||
data.data.combat.push(RdDItemArme.mainsNues({ niveau: corpsACorps.data.niveau, initiative: cc_init }));
|
||||
}
|
||||
this.armesList = duplicate(data.data.combat);
|
||||
|
||||
|
@ -529,13 +529,20 @@
|
||||
</li>
|
||||
{{#each data.combat as |arme key|}}
|
||||
<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="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" name="data.armes[{{key}}].data.dommages">{{numberFormat arme.data.dommages decimals=0 sign=true}}</span>
|
||||
<span class="competence-value">{{numberFormat arme.data.niveau decimals=0 sign=true}}</span>
|
||||
<span class="competence-value">{{numberFormat arme.data.dommages decimals=0 sign=true}}</span>
|
||||
</li>
|
||||
{{/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>
|
||||
</div>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user