forked from public/foundryvtt-reve-de-dragon
Nouveau roll-dialog: mode attaque / defense
This commit is contained in:
@@ -19,14 +19,14 @@ export class RollPartTache extends RollPartSelect {
|
||||
loadRefs(rollData) {
|
||||
const refs = this.getRefs(rollData)
|
||||
refs.taches = rollData.active.actor.itemTypes[ITEM_TYPES.tache]
|
||||
.filter(tache => tache.system.points_de_tache_courant < tache.system.points_de_tache)
|
||||
.map(tache => RollPartTache.$extractTache(tache, rollData.active.actor))
|
||||
.filter(tache => tache.system.points_de_tache_courant < tache.system.points_de_tache)
|
||||
.map(tache => RollPartTache.$extractTache(tache, rollData.active.actor))
|
||||
if (refs.taches.length > 0) {
|
||||
this.$selectTache(rollData)
|
||||
}
|
||||
}
|
||||
choices(refs) { return refs.taches }
|
||||
|
||||
|
||||
static $extractTache(tache, actor) {
|
||||
return {
|
||||
key: tache.id,
|
||||
@@ -53,12 +53,12 @@ export class RollPartTache extends RollPartSelect {
|
||||
})
|
||||
}
|
||||
|
||||
getExternalPartsFilter(partCode, rollData) {
|
||||
impactOtherPart(part, rollData) {
|
||||
if (this.visible(rollData)) {
|
||||
const current = this.getCurrent(rollData)
|
||||
switch (partCode) {
|
||||
case PART_CARAC: return p => Grammar.equalsInsensitive(p.key, current?.tache.system.carac)
|
||||
case PART_COMP: return p => p.label == current?.comp.name
|
||||
switch (part.code) {
|
||||
case PART_CARAC: return part.filterCaracs(rollData, [current?.tache.system.carac])
|
||||
case PART_COMP: return part.filterComps(rollData, [current.comp?.name])
|
||||
}
|
||||
}
|
||||
return undefined
|
||||
|
||||
Reference in New Issue
Block a user