PNJ: support initiative

This commit is contained in:
Vincent Vandemeulebrouck 2024-10-27 00:01:33 +02:00
parent 92185d4a5b
commit 1760d26014
3 changed files with 7 additions and 3 deletions

View File

@ -224,7 +224,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
this.html.find('.roll-arme').click(async event => this.actor.rollArme(foundry.utils.duplicate(this._getEventArmeCombat(event)), 'competence')) this.html.find('.roll-arme').click(async event => this.actor.rollArme(foundry.utils.duplicate(this._getEventArmeCombat(event)), 'competence'))
// Initiative pour l'arme // Initiative pour l'arme
this.html.find('.arme-initiative a').click(async event => { this.html.find('.roll-init-arme').click(async event => {
let combatant = game.combat.combatants.find(c => c.actor.id == this.actor.id) let combatant = game.combat.combatants.find(c => c.actor.id == this.actor.id)
if (combatant) { if (combatant) {
RdDCombatManager.rollInitiativeAction(combatant._id, this._getEventArmeCombat(event)); RdDCombatManager.rollInitiativeAction(combatant._id, this._getEventArmeCombat(event));

View File

@ -25,7 +25,7 @@
<span class="competence-value">{{plusMoins arme.system.niveau}}</span> <span class="competence-value">{{plusMoins arme.system.niveau}}</span>
<span class="competence-value">{{plusMoins arme.system.dommagesReels}}</span> <span class="competence-value">{{plusMoins arme.system.dommagesReels}}</span>
<span class="competence-value"></span> <span class="competence-value"></span>
<span class="initiative-value arme-initiative"><a data-tooltip="{{arme.name}}: initiative {{arme.system.initiative}}">{{arme.system.initiative}}</a></span> <span class="initiative-value"><a class="roll-init-arme" data-tooltip="{{arme.name}}: initiative {{arme.system.initiative}}">{{arme.system.initiative}}</a></span>
</li> </li>
{{/each}} {{/each}}
{{#each esquives as |esq key|}} {{#each esquives as |esq key|}}

View File

@ -10,7 +10,11 @@
<div class="flexrow"> <div class="flexrow">
<div>{{niveau}}</div> <div>{{niveau}}</div>
{{#if init}} {{#if init}}
{{#if name}}
<div><a class="roll-init-arme">{{init}}</a></div>
{{else}}
<div>{{init}}</div> <div>{{init}}</div>
{{/if}}
<div>{{dommages}}</div> <div>{{dommages}}</div>
{{else}} {{else}}
<div></div> <div></div>