Fenêtres Roll V2
Maintenant disponibles pour: - méditation - tâches - soins
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { ITEM_TYPES } from "../constants.js"
|
||||
import { Grammar } from "../grammar.js"
|
||||
import { ROLL_TYPE_TACHE } from "./roll-constants.mjs"
|
||||
import { PART_CARAC } from "./roll-part-carac.mjs"
|
||||
import { PART_COMP } from "./roll-part-comp.mjs"
|
||||
@@ -18,13 +17,17 @@ export class RollPartTache extends RollPartSelect {
|
||||
|
||||
loadRefs(rollData) {
|
||||
const refs = this.getRefs(rollData)
|
||||
refs.taches = rollData.active.actor.itemTypes[ITEM_TYPES.tache]
|
||||
const selected = this.getSelected(rollData)
|
||||
refs.all = rollData.active.actor.itemTypes[ITEM_TYPES.tache]
|
||||
.filter(tache => !selected.forced || tache.id == selected.key)
|
||||
.filter(tache => tache.system.points_de_tache_courant < tache.system.points_de_tache)
|
||||
.map(tache => RollPartTache.$extractTache(tache, rollData.active.actor))
|
||||
refs.taches = refs.all
|
||||
if (refs.taches.length > 0) {
|
||||
this.$selectTache(rollData)
|
||||
}
|
||||
}
|
||||
|
||||
choices(refs) { return refs.taches }
|
||||
|
||||
static $extractTache(tache, actor) {
|
||||
|
Reference in New Issue
Block a user