Added school_ability and mastery_ability types for techniques
This commit is contained in:
@@ -122,6 +122,7 @@
|
|||||||
"title": "Techniques",
|
"title": "Techniques",
|
||||||
"title_new": "New Technique",
|
"title_new": "New Technique",
|
||||||
"not_allowed": "Your character does not use this type of technique.",
|
"not_allowed": "Your character does not use this type of technique.",
|
||||||
|
"only_one": "Your character can possess only one of theses technique.",
|
||||||
"type": "Allowed Techniques",
|
"type": "Allowed Techniques",
|
||||||
"kata": "Kata",
|
"kata": "Kata",
|
||||||
"kiho": "Kihõ",
|
"kiho": "Kihõ",
|
||||||
@@ -129,7 +130,9 @@
|
|||||||
"ritual": "Ritual",
|
"ritual": "Ritual",
|
||||||
"shuji": "Shuji",
|
"shuji": "Shuji",
|
||||||
"maho": "Mahõ",
|
"maho": "Mahõ",
|
||||||
"ninjutsu": "Ninjutsu"
|
"ninjutsu": "Ninjutsu",
|
||||||
|
"school_ability": "School Ability",
|
||||||
|
"mastery_ability": "Mastery Ability"
|
||||||
},
|
},
|
||||||
"peculiarities": {
|
"peculiarities": {
|
||||||
"title_new": "New peculiarity",
|
"title_new": "New peculiarity",
|
||||||
|
|||||||
@@ -122,6 +122,7 @@
|
|||||||
"title": "Techniques",
|
"title": "Techniques",
|
||||||
"type": "Tipo accesible",
|
"type": "Tipo accesible",
|
||||||
"not_allowed": "Your character does not use this type of technique.",
|
"not_allowed": "Your character does not use this type of technique.",
|
||||||
|
"only_one": "Your character can possess only one of theses technique.",
|
||||||
"title_new": "Nuevo Rasgo",
|
"title_new": "Nuevo Rasgo",
|
||||||
"kata": "Kata",
|
"kata": "Kata",
|
||||||
"kiho": "Kihõ",
|
"kiho": "Kihõ",
|
||||||
@@ -129,7 +130,9 @@
|
|||||||
"ritual": "Ritual",
|
"ritual": "Ritual",
|
||||||
"shuji": "Shuji",
|
"shuji": "Shuji",
|
||||||
"maho": "Mahõ",
|
"maho": "Mahõ",
|
||||||
"ninjutsu": "Ninjutsu"
|
"ninjutsu": "Ninjutsu",
|
||||||
|
"school_ability": "School Ability",
|
||||||
|
"mastery_ability": "Mastery Ability"
|
||||||
},
|
},
|
||||||
"peculiarities": {
|
"peculiarities": {
|
||||||
"title_new": "New peculiarity",
|
"title_new": "New peculiarity",
|
||||||
|
|||||||
@@ -122,6 +122,7 @@
|
|||||||
"title": "Techniques",
|
"title": "Techniques",
|
||||||
"title_new": "Nouvelle Technique",
|
"title_new": "Nouvelle Technique",
|
||||||
"not_allowed": "Votre personnage n'utilise pas ce type de technique.",
|
"not_allowed": "Votre personnage n'utilise pas ce type de technique.",
|
||||||
|
"only_one": "Votre personnage ne peut avoir qu'une seule de ces technique.",
|
||||||
"type": "Type accessible",
|
"type": "Type accessible",
|
||||||
"kata": "Kata",
|
"kata": "Kata",
|
||||||
"kiho": "Kihõ",
|
"kiho": "Kihõ",
|
||||||
@@ -129,7 +130,9 @@
|
|||||||
"ritual": "Rituel",
|
"ritual": "Rituel",
|
||||||
"shuji": "Shuji",
|
"shuji": "Shuji",
|
||||||
"maho": "Mahõ",
|
"maho": "Mahõ",
|
||||||
"ninjutsu": "Ninjutsu"
|
"ninjutsu": "Ninjutsu",
|
||||||
|
"school_ability": "Capacité d'école",
|
||||||
|
"mastery_ability": "Capacité de maîtrise"
|
||||||
},
|
},
|
||||||
"peculiarities": {
|
"peculiarities": {
|
||||||
"title_new": "Nouvelle particularité",
|
"title_new": "Nouvelle particularité",
|
||||||
|
|||||||
@@ -94,19 +94,41 @@ export class BaseSheetL5r5e extends ActorSheet {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "technique":
|
case "technique":
|
||||||
// Check if technique is allowed for this character
|
// School_ability and mastery_ability, allow only 1 per type
|
||||||
if (!game.user.isGM && !this.actor.data.data.techniques[item.data.data.technique_type]) {
|
if (CONFIG.l5r5e.techniques_school.includes(item.data.data.technique_type)) {
|
||||||
new Dialog({
|
if (
|
||||||
title: game.i18n.localize("l5r5e.techniques.title"),
|
Array.from(this.actor.items).some(
|
||||||
content: game.i18n.localize("l5r5e.techniques.not_allowed"),
|
(e) =>
|
||||||
buttons: {
|
e.type === "technique" && e.data.data.technique_type === item.data.data.technique_type
|
||||||
ok: {
|
)
|
||||||
label: game.i18n.localize("l5r5e.global.ok"),
|
) {
|
||||||
icon: '<i class="fas fa-check"></i>',
|
new Dialog({
|
||||||
|
title: game.i18n.localize("l5r5e.techniques.title"),
|
||||||
|
content: game.i18n.localize("l5r5e.techniques.only_one"),
|
||||||
|
buttons: {
|
||||||
|
ok: {
|
||||||
|
label: game.i18n.localize("l5r5e.global.ok"),
|
||||||
|
icon: '<i class="fas fa-check"></i>',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
}).render(true);
|
||||||
}).render(true);
|
return;
|
||||||
return;
|
}
|
||||||
|
} else {
|
||||||
|
// Check if technique is allowed for this character
|
||||||
|
if (!game.user.isGM && !this.actor.data.data.techniques[item.data.data.technique_type]) {
|
||||||
|
new Dialog({
|
||||||
|
title: game.i18n.localize("l5r5e.techniques.title"),
|
||||||
|
content: game.i18n.localize("l5r5e.techniques.not_allowed"),
|
||||||
|
buttons: {
|
||||||
|
ok: {
|
||||||
|
label: game.i18n.localize("l5r5e.global.ok"),
|
||||||
|
icon: '<i class="fas fa-check"></i>',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}).render(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modify the bought at rank to the current actor rank
|
// Modify the bought at rank to the current actor rank
|
||||||
|
|||||||
@@ -198,9 +198,23 @@ export class TwentyQuestionsDialog extends FormApplication {
|
|||||||
// Specific entry
|
// Specific entry
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "technique":
|
case "technique":
|
||||||
// Tech not allowed
|
// School Ability
|
||||||
if (!this.actor.data.data.techniques[item.data.data.technique_type]) {
|
if (stepKey === "step3.school_ability") {
|
||||||
console.warn("This technique is not allowed for your character", type, item.data.type);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ L5R5E.paths = {
|
|||||||
|
|
||||||
L5R5E.stances = ["earth", "air", "water", "fire", "void"];
|
L5R5E.stances = ["earth", "air", "water", "fire", "void"];
|
||||||
L5R5E.techniques = ["kata", "kiho", "invocation", "ritual", "shuji", "maho", "ninjutsu"];
|
L5R5E.techniques = ["kata", "kiho", "invocation", "ritual", "shuji", "maho", "ninjutsu"];
|
||||||
|
L5R5E.techniques_school = ["school_ability", "mastery_ability"];
|
||||||
L5R5E.xp = {
|
L5R5E.xp = {
|
||||||
costPerRank: [0, 20, 24, 32, 44, 60],
|
costPerRank: [0, 20, 24, 32, 44, 60],
|
||||||
ringCostMultiplier: 3,
|
ringCostMultiplier: 3,
|
||||||
|
|||||||
@@ -14,4 +14,19 @@ export class TechniqueSheetL5r5e extends ItemSheetL5r5e {
|
|||||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],
|
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
async getData() {
|
||||||
|
const sheetData = await super.getData();
|
||||||
|
|
||||||
|
// Add "school ability" and "mastery ability"
|
||||||
|
CONFIG.l5r5e.techniques_school.forEach((e) => {
|
||||||
|
sheetData.data.techniquesList.push({
|
||||||
|
id: e,
|
||||||
|
label: game.i18n.localize(`l5r5e.techniques.${e}`),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return sheetData;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user