forked from public/foundryvtt-reve-de-dragon
Préparation roll-dialog attaques
Les attaques ne sont plus des armes modifiées
This commit is contained in:
@@ -33,7 +33,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
width: 550,
|
||||
showCompNiveauBase: false,
|
||||
vueArchetype: false,
|
||||
}, { inplace: false });
|
||||
}, { inplace: false })
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -77,14 +77,10 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
});
|
||||
|
||||
// toujours avoir une liste d'armes (pour mettre esquive et corps à corps)
|
||||
const actor = this.actor;
|
||||
formData.combat = foundry.utils.duplicate(formData.armes);
|
||||
RdDItemArme.computeNiveauArmes(formData.combat, formData.competences);
|
||||
formData.combat.push(RdDItemArme.corpsACorps(actor));
|
||||
formData.combat.push(RdDItemArme.empoignade(actor));
|
||||
const actor = this.actor
|
||||
|
||||
formData.esquives = this.actor.getCompetencesEsquive()
|
||||
formData.combat = RdDCombatManager.listActionsArmes(formData.combat, formData.competences, formData.system.carac);
|
||||
formData.combat = actor.listActionsAttaque()
|
||||
formData.empoignades = this.actor.getEmpoignades();
|
||||
|
||||
this.armesList = formData.combat;
|
||||
@@ -216,13 +212,17 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
this.html.find('.roll-reve-actuel').click(async event => await this.actor.rollCarac('reve-actuel', { resistance: true }))
|
||||
this.html.find('.action-empoignade').click(async event => await RdDEmpoignade.onAttaqueEmpoignadeFromItem(RdDSheetUtility.getItem(event, this.actor)))
|
||||
|
||||
this.html.find('.roll-arme').click(async event => await this.actor.rollArme(foundry.utils.duplicate(this._getEventArmeCombat(event)), 'competence'))
|
||||
this.html.find('.roll-arme').click(async event => {
|
||||
const action = this._getActionCombat(event);
|
||||
await this.actor.rollArme(action.arme, action.main)
|
||||
|
||||
})
|
||||
|
||||
// Initiative pour l'arme
|
||||
this.html.find('.roll-init-arme').click(async event => {
|
||||
let combatant = game.combat.combatants.find(c => c.actor.id == this.actor.id)
|
||||
if (combatant) {
|
||||
RdDCombatManager.rollInitiativeAction(combatant._id, this._getEventArmeCombat(event));
|
||||
RdDCombatManager.rollInitiativeAction(combatant._id, this._getActionCombat(event));
|
||||
} else {
|
||||
ui.notifications.info("Impossible de lancer l'initiative sans être dans un combat.");
|
||||
}
|
||||
@@ -236,11 +236,11 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
|
||||
this.html.find('.carac-xp-augmenter').click(async event => await this.actor.updateCaracXPAuto(event.currentTarget.name.replace("augmenter.", "")))
|
||||
this.html.find('.competence-xp-augmenter').click(async event => await this.actor.updateCompetenceXPAuto(RdDSheetUtility.getItemId(event)))
|
||||
this.html.find('.competence-stress-augmenter').click(async event =>{
|
||||
this.html.find('.competence-stress-augmenter').click(async event => {
|
||||
await this.actor.updateCompetenceStress(RdDSheetUtility.getItemId(event))
|
||||
this.render(true)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
if (this.options.vueDetaillee) {
|
||||
// On carac change
|
||||
@@ -346,13 +346,17 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
await this.actor.createItem('tache', 'Nouvelle tache');
|
||||
}
|
||||
|
||||
_getEventArmeCombat(event) {
|
||||
_getActionCombat(event) {
|
||||
const li = this.html.find(event.currentTarget)?.parents(".item");
|
||||
let armeName = li.data("arme-name");
|
||||
let compName = li.data('competence-name');
|
||||
const arme = this.armesList.find(a => a.name == armeName && a.system.competence == compName);
|
||||
const arme = this.armesList.find(a => a.arme.name == armeName && a.comp.name == compName);
|
||||
if (!arme) {
|
||||
return { name: armeName, system: { competence: compName } };
|
||||
return {
|
||||
name: armeName,
|
||||
arme: { name: armeName },
|
||||
comp: { name: compName }
|
||||
}
|
||||
}
|
||||
return arme;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user