Working on 0.8.x
- Showing titles (title_ability) in techniques pc/npc
This commit is contained in:
@@ -16,11 +16,8 @@ export class BaseSheetL5r5e extends ActorSheet {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Commons datas
|
||||
* @override
|
||||
*/
|
||||
getData(options) {
|
||||
/** @inheritdoc */
|
||||
getData(options = {}) {
|
||||
const sheetData = super.getData(options);
|
||||
|
||||
sheetData.data.dtypes = ["String", "Number", "Boolean"];
|
||||
@@ -64,11 +61,17 @@ export class BaseSheetL5r5e extends ActorSheet {
|
||||
break;
|
||||
|
||||
case "title":
|
||||
// Embed technique in titles
|
||||
Array.from(item.data.items).forEach(([id, embedItem]) => {
|
||||
if (embedItem.data.type === "technique") {
|
||||
out[embedItem.data.data.technique_type].push(embedItem.data);
|
||||
}
|
||||
});
|
||||
|
||||
// If unlocked, add the "title_ability" as technique (or always displayed for npc)
|
||||
if (item.data.xp_used >= item.data.xp_cost || this.document.type === "npc") {
|
||||
out["title_ability"].push(item);
|
||||
}
|
||||
break;
|
||||
} //swi
|
||||
});
|
||||
@@ -84,10 +87,11 @@ export class BaseSheetL5r5e extends ActorSheet {
|
||||
sheetData.data.data.techniques["school_ability"] = out["school_ability"].length === 0;
|
||||
sheetData.data.data.techniques["mastery_ability"] = out["mastery_ability"].length === 0;
|
||||
|
||||
// Always display "school_ability", but display "mastery_ability" only if rank >= 5
|
||||
// Always display "school_ability", but display a empty "mastery_ability" field only if rank >= 5
|
||||
if (sheetData.data.data.identity?.school_rank < 5 && out["mastery_ability"].length === 0) {
|
||||
delete out["mastery_ability"];
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,9 +16,11 @@ export class NpcSheetL5r5e extends BaseSheetL5r5e {
|
||||
});
|
||||
}
|
||||
|
||||
getData() {
|
||||
/** @inheritdoc */
|
||||
getData(options = {}) {
|
||||
const sheetData = super.getData();
|
||||
|
||||
// NPC Subtypes
|
||||
sheetData.data.data.types = NpcSheetL5r5e.types.map((e) => ({
|
||||
id: e,
|
||||
label: game.i18n.localize("l5r5e.character_types." + e),
|
||||
|
||||
@@ -23,7 +23,7 @@ L5R5E.techniques.set("ninjutsu", { type: "core", displayInTypes: true });
|
||||
L5R5E.techniques.set("school_ability", { type: "school", displayInTypes: false });
|
||||
L5R5E.techniques.set("mastery_ability", { type: "school", displayInTypes: false });
|
||||
// Title
|
||||
// L5R5E.techniques.set("title_ability", { type: "title", displayInTypes: false });
|
||||
L5R5E.techniques.set("title_ability", { type: "title", displayInTypes: false });
|
||||
// Custom
|
||||
L5R5E.techniques.set("specificity", { type: "custom", displayInTypes: false });
|
||||
|
||||
|
||||
@@ -162,6 +162,7 @@
|
||||
"advancement": {
|
||||
"in_curriculum": false,
|
||||
"xp_used": 3,
|
||||
"xp_cost": 3,
|
||||
"rank": 1,
|
||||
"bought_at_rank": 1,
|
||||
"ring": "void"
|
||||
@@ -198,8 +199,7 @@
|
||||
},
|
||||
"technique": {
|
||||
"templates": ["basics", "advancement"],
|
||||
"technique_type": "kata",
|
||||
"xp_cost": 3
|
||||
"technique_type": "kata"
|
||||
},
|
||||
"property": {
|
||||
"templates": ["basics"]
|
||||
@@ -216,23 +216,19 @@
|
||||
},
|
||||
"title": {
|
||||
"templates": ["basics", "advancement"],
|
||||
"xp_cost": 3,
|
||||
"advancements": []
|
||||
},
|
||||
"bond": {
|
||||
"templates": ["basics", "advancement"],
|
||||
"bond_type": "",
|
||||
"xp_cost": 3
|
||||
"bond_type": ""
|
||||
},
|
||||
"item_pattern": {
|
||||
"templates": ["basics", "advancement"],
|
||||
"linked_property_id": null,
|
||||
"rarity_modifier": "",
|
||||
"xp_cost": 3
|
||||
"rarity_modifier": ""
|
||||
},
|
||||
"signature_scroll": {
|
||||
"templates": ["basics", "advancement"],
|
||||
"xp_cost": 3
|
||||
"templates": ["basics", "advancement"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user