Nouveau roll-dialog: mode attaque / defense

This commit is contained in:
2025-09-21 00:15:21 +02:00
parent 607eedc6d2
commit 0730bdf240
52 changed files with 940 additions and 415 deletions

View File

@@ -6,6 +6,7 @@ import { ROLLDIALOG_SECTION } from "./roll-part.mjs"
import { TMRUtility } from "../tmr-utility.js"
import { RdDItemSort } from "../item-sort.js"
import { RollPartSelect } from "./roll-part-select.mjs"
import { CARACS } from "../rdd-carac.js"
export const PART_SORT = "sort"
@@ -115,12 +116,12 @@ export class RollPartSort extends RollPartSelect {
})
}
getExternalPartsFilter(partCode, rollData) {
impactOtherPart(part, rollData) {
if (this.visible(rollData)) {
const current = this.getCurrent(rollData)
switch (partCode) {
case PART_CARAC: return p => p.key == 'reve'
case PART_COMP: return p => current.draconics?.includes(p.label)
switch (part.code) {
case PART_CARAC: return part.filterCaracs(rollData, [CARACS.REVE])
case PART_COMP: return part.filterComps(rollData,current.draconics ?? [])
}
}
return undefined