Added school_ability and mastery_ability types for techniques

This commit is contained in:
Vlyan
2021-01-01 12:56:36 +01:00
parent 712b0e1d2a
commit b02407a67b
7 changed files with 79 additions and 18 deletions

View File

@@ -198,9 +198,23 @@ export class TwentyQuestionsDialog extends FormApplication {
// Specific entry
switch (type) {
case "technique":
// Tech not allowed
if (!this.actor.data.data.techniques[item.data.data.technique_type]) {
console.warn("This technique is not allowed for your character", type, item.data.type);
// School Ability
if (stepKey === "step3.school_ability") {
if (item.data.data.technique_type !== "school_ability") {
// console.warn("This technique is not a school ability");
return;
}
if (
Array.from(this.actor.items).some(
(e) => e.type === "technique" && e.data.data.technique_type === "school_ability"
)
) {
// console.warn("This technique is not a school ability", item.data.data.technique_type);
return;
}
} else if (!this.actor.data.data.techniques[item.data.data.technique_type]) {
// Tech not allowed
// console.warn("This technique is not allowed for your character", item.data.data.technique_type);
return;
}
break;