working on some parts of Sheets

This commit is contained in:
Vlyan
2020-12-15 19:30:01 +01:00
parent 971c33321e
commit bee3be183e
28 changed files with 546 additions and 334 deletions

View File

@@ -88,10 +88,19 @@
"armors": { "armors": {
"title": "Armors", "title": "Armors",
"physical": "physical", "physical": "physical",
"spiritual": "spiritual" "supernatural": "supernatural"
}, },
"items": "Items", "items": "Items",
"feats": "Feats", "feats": {
"title": "Feats",
"kata": "Kata",
"kiho": "Kihõ",
"invocation": "Invocation",
"ritual": "Ritual",
"shuji": "Shuji",
"maho": "Mahõ",
"ninjutsu": "Ninjutsu"
},
"skill": "Skill", "skill": "Skill",
"level": "Level", "level": "Level",
"approaches": "Approaches", "approaches": "Approaches",
@@ -207,6 +216,31 @@
"spent": "Used", "spent": "Used",
"saved": "Saved", "saved": "Saved",
"acquisitions": "Acquisitions" "acquisitions": "Acquisitions"
},
"twenty_questions": {
"title": "Twenty questions",
"bt_abrev": "20Q",
"part1": {
"title": "Partie I: Core Identity (Clan and Family)"
},
"part2": {
"title": "Partie II: Role and School"
},
"part3": {
"title": "Partie III: Honor and Glory"
},
"part4": {
"title": "Partie IV: Strengths and Weaknesses"
},
"part5": {
"title": "Partie V: Personality and Behavior"
},
"part6": {
"title": "Partie VI: Ancestry and Family"
},
"part7": {
"title": "Partie VII: Death"
}
} }
} }
} }

View File

@@ -88,10 +88,19 @@
"armors": { "armors": {
"title": "Armors", "title": "Armors",
"physical": "physical", "physical": "physical",
"spiritual": "spiritual" "supernatural": "supernatural"
}, },
"items": "Equipo", "items": "Equipo",
"feats": "Rasgos", "feats": {
"title": "Rasgos",
"kata": "Kata",
"kiho": "Kihõ",
"invocation": "Invocation",
"ritual": "Ritual",
"shuji": "Shuji",
"maho": "Mahõ",
"ninjutsu": "Ninjutsu"
},
"skill": "Habilidad", "skill": "Habilidad",
"level": "Nivel", "level": "Nivel",
"approaches": "Planteamientos", "approaches": "Planteamientos",
@@ -206,6 +215,31 @@
"spent": "Usada", "spent": "Usada",
"saved": "Restante", "saved": "Restante",
"acquisitions": "Adquisiciones" "acquisitions": "Adquisiciones"
},
"twenty_questions": {
"title": "Twenty questions",
"bt_abrev": "20Q",
"part1": {
"title": "Partie I: Core Identity (Clan and Family)"
},
"part2": {
"title": "Partie II: Role and School"
},
"part3": {
"title": "Partie III: Honor and Glory"
},
"part4": {
"title": "Partie IV: Strengths and Weaknesses"
},
"part5": {
"title": "Partie V: Personality and Behavior"
},
"part6": {
"title": "Partie VI: Ancestry and Family"
},
"part7": {
"title": "Partie VII: Death"
}
} }
} }
} }

View File

@@ -88,17 +88,26 @@
"armors": { "armors": {
"title": "Armures", "title": "Armures",
"physical": "Physique", "physical": "Physique",
"spiritual": "Spirituelle" "supernatural": "Spirituelle"
},
"items": "Objets",
"feats": {
"title": "Techniques",
"kata": "Kata",
"kiho": "Kihõ",
"invocation": "Invocation",
"ritual": "Rituel",
"shuji": "Shuji",
"maho": "Mahõ",
"ninjutsu": "Ninjutsu"
}, },
"items": "Equipement",
"feats": "Techniques",
"skill": "Compétence", "skill": "Compétence",
"level": "Niveau", "level": "Niveau",
"approaches": "Approches", "approaches": "Approches",
"featplaceholdername": "Nouvelle technique", "featplaceholdername": "Nouvelle technique",
"notes": "Notes", "notes": "Notes",
"inventory": "Inventaire", "inventory": "Inventaire",
"equipment": "Equipement", "equipment": "Équipement",
"rank": "Rang", "rank": "Rang",
"name": "Nom", "name": "Nom",
"social": { "social": {
@@ -207,6 +216,31 @@
"spent": "Dépensée", "spent": "Dépensée",
"saved": "Restante", "saved": "Restante",
"acquisitions": "Acquisitions" "acquisitions": "Acquisitions"
},
"twenty_questions": {
"title": "Vingt questions",
"bt_abrev": "20Q",
"part1": {
"title": "Partie I: Identité (clan et famille)"
},
"part2": {
"title": "Partie II: Rôle et École"
},
"part3": {
"title": "Partie III: Honneur et Gloire"
},
"part4": {
"title": "Partie IV: Forces et Faiblesses"
},
"part5": {
"title": "Partie V: Personnalité et Comportement"
},
"part6": {
"title": "Partie VI: Lignée et Famille"
},
"part7": {
"title": "Partie VII: Mort"
}
} }
} }
} }

View File

@@ -7,10 +7,38 @@ export class ActorL5r5e extends Actor {
* @override * @override
*/ */
static async create(data, options = {}) { static async create(data, options = {}) {
if (!Object.keys(data).includes("type")) { // if (!Object.keys(data).includes("type")) {
data.type = "character"; // data.type = "character";
} // }
// Some tweak on actors
data.token = data.token || {};
switch (data.type) {
case "character":
mergeObject(
data.token,
{
// vision: true,
// dimSight: 30,
// brightSight: 0,
actorLink: true,
disposition: 1, // friendly
},
{ overwrite: false }
);
break;
case "npc":
mergeObject(
data.token,
{
actorLink: false,
disposition: 0, // neutral
},
{ overwrite: false }
);
break;
}
await super.create(data, options); await super.create(data, options);
} }

View File

@@ -0,0 +1,48 @@
import { ItemSheetL5r5e } from "./item-sheet.js";
/**
* @extends {ItemSheet}
*/
export class QualitySheetL5r5e extends ItemSheetL5r5e {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["l5r5e", "sheet", "quality"],
template: CONFIG.L5r5e.paths.templates + "item/quality-sheet.html",
width: 520,
height: 480,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],
});
}
getData() {
const sheetData = super.getData();
sheetData.data.dtypes = ["String", "Number", "Boolean"];
sheetData.data.isQuality = true;
return sheetData;
}
/**
* Subscribe to events from the sheet.
* @param html HTML content of the sheet.
*/
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) {
return;
}
}
/**
* Update item with values from the sheet.
* @param event
* @param formData
*/
_updateObject(event, formData) {
return this.object.update(formData);
}
}

View File

@@ -1,3 +1,4 @@
import { L5R5E } from "../l5r5e-config.js";
import { ItemSheetL5r5e } from "./item-sheet.js"; import { ItemSheetL5r5e } from "./item-sheet.js";
/** /**
@@ -21,6 +22,9 @@ export class WeaponSheetL5r5e extends ItemSheetL5r5e {
sheetData.data.isWeapon = true; sheetData.data.isWeapon = true;
sheetData.data.isEquipment = true; sheetData.data.isEquipment = true;
sheetData.data.skills = Array.from(L5R5E.skills)
.filter(([id, cat]) => cat === "martial")
.map(([id, cat]) => id);
return sheetData; return sheetData;
} }

View File

@@ -6,6 +6,7 @@ L5R5E.paths = {
}; };
L5R5E.stances = ["earth", "air", "water", "fire", "void"]; L5R5E.stances = ["earth", "air", "water", "fire", "void"];
L5R5E.feats = ["kata", "kiho", "invocation", "ritual", "shuji", "maho", "ninjutsu"];
// Map SkillId - CategoryId // Map SkillId - CategoryId
L5R5E.skills = new Map(); L5R5E.skills = new Map();

View File

@@ -11,6 +11,7 @@ import { ItemSheetL5r5e } from "./items/item-sheet.js";
import { ArmorSheetL5r5e } from "./items/armor-sheet.js"; import { ArmorSheetL5r5e } from "./items/armor-sheet.js";
import { WeaponSheetL5r5e } from "./items/weapon-sheet.js"; import { WeaponSheetL5r5e } from "./items/weapon-sheet.js";
import { FeatSheetL5r5e } from "./items/feat-sheet.js"; import { FeatSheetL5r5e } from "./items/feat-sheet.js";
import { QualitySheetL5r5e } from "./items/quality-sheet.js";
// Import Dice Types // Import Dice Types
@@ -67,6 +68,7 @@ Hooks.once("init", async function () {
Items.registerSheet("l5r5e", ArmorSheetL5r5e, { types: ["armor"], makeDefault: true }); Items.registerSheet("l5r5e", ArmorSheetL5r5e, { types: ["armor"], makeDefault: true });
Items.registerSheet("l5r5e", WeaponSheetL5r5e, { types: ["weapon"], makeDefault: true }); Items.registerSheet("l5r5e", WeaponSheetL5r5e, { types: ["weapon"], makeDefault: true });
Items.registerSheet("l5r5e", FeatSheetL5r5e, { types: ["feat"], makeDefault: true }); Items.registerSheet("l5r5e", FeatSheetL5r5e, { types: ["feat"], makeDefault: true });
Items.registerSheet("l5r5e", QualitySheetL5r5e, { types: ["quality"], makeDefault: true });
// for debug // for debug
Handlebars.registerHelper("json", function (...objects) { Handlebars.registerHelper("json", function (...objects) {
@@ -108,6 +110,10 @@ Hooks.once("init", async function () {
const key = "l5r5e.conflict.stances." + ringName.toLowerCase() + "tip"; const key = "l5r5e.conflict.stances." + ringName.toLowerCase() + "tip";
return game.i18n.localize(key); return game.i18n.localize(key);
}); });
Handlebars.registerHelper("localizeFeat", function (featName) {
return game.i18n.localize("l5r5e.feats." + featName.toLowerCase());
});
}); });
/* ------------------------------------ */ /* ------------------------------------ */

View File

@@ -23,6 +23,9 @@ export const PreloadTemplates = async function () {
"systems/l5r5e/templates/item/armor-entry.html", "systems/l5r5e/templates/item/armor-entry.html",
"systems/l5r5e/templates/item/feat-sheet.html", "systems/l5r5e/templates/item/feat-sheet.html",
"systems/l5r5e/templates/item/feat-entry.html", "systems/l5r5e/templates/item/feat-entry.html",
"systems/l5r5e/templates/item/qualities.html",
"systems/l5r5e/templates/item/quality-sheet.html",
"systems/l5r5e/templates/item/quality-entry.html",
]; ];
return loadTemplates(templatePaths); return loadTemplates(templatePaths);

View File

@@ -1,6 +1,10 @@
import { BaseSheetL5r5e } from "./base-sheet.js";
import { TwentyQuestionsDialog } from "./twenty-questions-dialog.js"; import { TwentyQuestionsDialog } from "./twenty-questions-dialog.js";
export class ActorSheetL5r5e extends ActorSheet { /**
* Actor / Character Sheet
*/
export class ActorSheetL5r5e extends BaseSheetL5r5e {
static get defaultOptions() { static get defaultOptions() {
return mergeObject(super.defaultOptions, { return mergeObject(super.defaultOptions, {
classes: ["l5r5e", "sheet", "actor"], classes: ["l5r5e", "sheet", "actor"],
@@ -20,7 +24,7 @@ export class ActorSheetL5r5e extends ActorSheet {
let buttons = super._getHeaderButtons(); let buttons = super._getHeaderButtons();
buttons.unshift({ buttons.unshift({
label: "20Q", // TODO localization label: game.i18n.localize("l5r5e.twenty_questions.bt_abrev"),
class: "twenty-questions", class: "twenty-questions",
icon: "fas fa-graduation-cap", icon: "fas fa-graduation-cap",
onclick: async () => { onclick: async () => {
@@ -30,139 +34,4 @@ export class ActorSheetL5r5e extends ActorSheet {
return buttons; return buttons;
} }
getData() {
const sheetData = super.getData();
this._prepareItems(sheetData);
const feats = sheetData.items.filter((item) => item.type === "feat");
sheetData.data.feats = feats;
return sheetData;
}
/**
* Update the actor.
* @param event
* @param formData
*/
_updateObject(event, formData) {
return this.object.update(formData);
}
/**
* Prepare item data to be displayed in the actor sheet.
* @param sheetData Data of the actor been displayed in the sheet.
*/
_prepareItems(sheetData) {
for (let item of sheetData.items) {
switch (item.type) {
case "weapon":
item.isWeapon = true;
item.isEquipment = true;
break;
case "armor":
item.isArmor = true;
item.isEquipment = true;
break;
case "feat":
item.isFeat = true;
break;
default:
item.isEquipment = true;
break;
}
}
}
_prepareFeats() {}
/**
* Subscribe to events from the sheet.
* @param html HTML content of the sheet.
*/
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find(".item-edit").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".item");
const itemId = li.data("itemId");
const item = this.actor.getOwnedItem(itemId);
item.sheet.render(true);
});
// Delete Inventory Item
html.find(".item-delete").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".item");
const itemId = li.data("itemId");
this.actor.deleteOwnedItem(itemId);
});
html.find(".feat-add").on("click", (ev) => {
this._createFeat();
});
html.find(".feat-delete").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".feat");
const featId = li.data("featId");
console.log("Remove feat" + featId + " clicked");
this.actor.deleteOwnedItem(featId);
});
html.find(".feat-edit").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".feat");
const featId = li.data("featId");
const feat = this.actor.getOwnedItem(featId);
feat.sheet.render(true);
});
html.find(".skill-name").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".skill");
const skillId = li.data("skill");
this._onSkillClicked(skillId);
});
html.find(".acquisition-add").on("click", (ev) => {
this._createFeat();
});
}
/**
* Creates a new feat for the character and shows a window to edit it.
*/
async _createFeat() {
const data = {
name: game.i18n.localize("l5r5e.featplaceholdername"),
type: "feat",
};
const created = await this.actor.createEmbeddedEntity("OwnedItem", data);
const feat = this.actor.getOwnedItem(created._id);
// Default values
//feat.rank = 1;
//feat.xp_used = 0;
feat.sheet.render(true);
return feat;
}
/**
* React to a skill from the skills list been clicked.
* @param {string} skillId Unique ID of the skill been clicked.
*/
async _onSkillClicked(skillId) {
new game.l5r5e.DicePickerDialog({ skillId: skillId, actor: this.actor }).render(true);
}
} }

View File

@@ -0,0 +1,153 @@
/**
* Base Sheet for Actor and Npc
*/
export class BaseSheetL5r5e extends ActorSheet {
/**
* Commons datas
*/
getData() {
const sheetData = super.getData();
this._prepareItems(sheetData);
const feats = sheetData.items.filter((item) => item.type === "feat");
sheetData.data.feats = feats;
sheetData.data.stances = CONFIG.L5r5e.stances;
return sheetData;
}
/**
* Update the actor.
* @param event
* @param formData
*/
_updateObject(event, formData) {
return this.object.update(formData);
}
/**
* Prepare item data to be displayed in the actor sheet.
* @param sheetData Data of the actor been displayed in the sheet.
*/
_prepareItems(sheetData) {
for (let item of sheetData.items) {
switch (item.type) {
case "weapon":
item.isWeapon = true;
item.isEquipment = true;
break;
case "armor":
item.isArmor = true;
item.isEquipment = true;
break;
case "feat":
item.isFeat = true;
break;
case "quality":
item.isQuality = true;
break;
case "xp-advancement":
item.isXpAdvancement = true;
break;
default:
item.isEquipment = true;
break;
}
}
}
/**
* TODO
*/
_prepareFeats() {}
/**
* Subscribe to events from the sheet.
* @param html HTML content of the sheet.
*/
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) {
return;
}
// Update Inventory Item
html.find(".item-edit").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".item");
const itemId = li.data("itemId");
const item = this.actor.getOwnedItem(itemId);
item.sheet.render(true);
});
// Delete Inventory Item
html.find(".item-delete").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".item");
this.actor.deleteOwnedItem(li.data("itemId"));
});
html.find(".feat-add").on("click", (ev) => {
this._createFeat();
});
html.find(".feat-delete").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".feat");
const featId = li.data("featId");
console.log("Remove feat" + featId + " clicked");
this.actor.deleteOwnedItem(featId);
});
html.find(".feat-edit").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".feat");
const featId = li.data("featId");
const feat = this.actor.getOwnedItem(featId);
feat.sheet.render(true);
});
html.find(".skill-name").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".skill");
this._onSkillClicked(li.data("skill"));
});
html.find(".acquisition-add").on("click", (ev) => {
this._createFeat();
});
}
/**
* Creates a new feat for the character and shows a window to edit it.
*/
async _createFeat() {
const data = {
name: game.i18n.localize("l5r5e.featplaceholdername"),
type: "feat",
};
const created = await this.actor.createEmbeddedEntity("OwnedItem", data);
const feat = this.actor.getOwnedItem(created._id);
// Default values
//feat.rank = 1;
//feat.xp_used = 0;
feat.sheet.render(true);
return feat;
}
/**
* React to a skill from the skills list been clicked.
* @param {string} skillId Unique ID of the skill been clicked.
*/
async _onSkillClicked(skillId) {
new game.l5r5e.DicePickerDialog({ skillId: skillId, actor: this.actor }).render(true);
}
}

View File

@@ -1,5 +1,9 @@
// TODO extend ActorSheetL5r5e ? import { BaseSheetL5r5e } from "./base-sheet.js";
export class NpcSheetL5r5e extends ActorSheet {
/**
* NPC Sheet
*/
export class NpcSheetL5r5e extends BaseSheetL5r5e {
static types = ["minion", "adversary"]; static types = ["minion", "adversary"];
static get defaultOptions() { static get defaultOptions() {
@@ -18,133 +22,8 @@ export class NpcSheetL5r5e extends ActorSheet {
this._prepareItems(sheetData); this._prepareItems(sheetData);
sheetData.data.feats = sheetData.items.filter((item) => item.type === "feat");
sheetData.data.types = NpcSheetL5r5e.types; sheetData.data.types = NpcSheetL5r5e.types;
sheetData.data.stances = CONFIG.L5r5e.stances;
return sheetData; return sheetData;
} }
/**
* Update the actor.
* @param event
* @param formData
*/
_updateObject(event, formData) {
return this.object.update(formData);
}
/**
* Prepare item data to be displayed in the actor sheet.
* @param sheetData Data of the actor been displayed in the sheet.
*/
_prepareItems(sheetData) {
for (let item of sheetData.items) {
switch (item.type) {
case "weapon":
item.isWeapon = true;
item.isEquipment = true;
break;
case "armor":
item.isArmor = true;
item.isEquipment = true;
break;
case "feat":
item.isFeat = true;
break;
default:
item.isEquipment = true;
break;
}
}
}
_prepareFeats() {}
/**
* Subscribe to events from the sheet.
* @param html HTML content of the sheet.
*/
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find(".item-edit").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".item");
const itemId = li.data("itemId");
const item = this.actor.getOwnedItem(itemId);
item.sheet.render(true);
});
// Delete Inventory Item
html.find(".item-delete").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".item");
const itemId = li.data("itemId");
this.actor.deleteOwnedItem(itemId);
});
html.find(".feat-add").on("click", (ev) => {
this._createFeat();
});
html.find(".feat-delete").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".feat");
const featId = li.data("featId");
console.log("Remove feat" + featId + " clicked");
this.actor.deleteOwnedItem(featId);
});
html.find(".feat-edit").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".feat");
const featId = li.data("featId");
const feat = this.actor.getOwnedItem(featId);
feat.sheet.render(true);
});
html.find(".skill-name").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".skill");
const skillId = li.data("skill");
this._onSkillClicked(skillId);
});
html.find(".acquisition-add").on("click", (ev) => {
this._createFeat();
});
}
/**
* Creates a new feat for the character and shows a window to edit it.
*/
async _createFeat() {
const data = {
name: game.i18n.localize("l5r5e.featplaceholdername"),
type: "feat",
};
const created = await this.actor.createEmbeddedEntity("OwnedItem", data);
const feat = this.actor.getOwnedItem(created._id);
// Default values
//feat.rank = 1;
//feat.xp_used = 0;
feat.sheet.render(true);
return feat;
}
/**
* React to a skill from the skills list been clicked.
* @param {string} skillId Unique ID of the skill been clicked.
*/
async _onSkillClicked(skillId) {
new game.l5r5e.DicePickerDialog({ skillId: skillId, actor: this.actor }).render(true);
}
} }

View File

@@ -44,6 +44,7 @@ export class TwentyQuestionsDialog extends FormApplication {
...super.getData(options), ...super.getData(options),
elementsList: this._getElements(), elementsList: this._getElements(),
skillsList: this._getSkills(), skillsList: this._getSkills(),
featsList: CONFIG.L5r5e.feats,
actor: this.actor.data.data, actor: this.actor.data.data,
}; };
} }
@@ -96,13 +97,13 @@ export class TwentyQuestionsDialog extends FormApplication {
actorTmp.social.glory = formData.step2_social_glory; actorTmp.social.glory = formData.step2_social_glory;
actorTmp.identity.school = formData.step3_school; actorTmp.identity.school = formData.step3_school;
actorTmp.identity.roles = formData.step3_roles; actorTmp.identity.roles = formData.step3_roles;
// actorTmp = formData.step3_tech_kata; // actorTmp = formData.step3_feat_kata;
// actorTmp = formData.step3_tech_kiho; // actorTmp = formData.step3_feat_kiho;
// actorTmp = formData.step3_tech_invocations; // actorTmp = formData.step3_feat_invocations;
// actorTmp = formData.step3_tech_rituals; // actorTmp = formData.step3_feat_rituals;
// actorTmp = formData.step3_tech_shuji; // actorTmp = formData.step3_feat_shuji;
// actorTmp = formData.step3_tech_maho; // actorTmp = formData.step3_feat_maho;
// actorTmp = formData.step3_tech_ninjutsu; // actorTmp = formData.step3_feat_ninjutsu;
// actorTmp = formData.step3_feats; // actorTmp = formData.step3_feats;
// actorTmp = formData.step3_school_ability; // actorTmp = formData.step3_school_ability;
// actorTmp = formData.step3_equipment; // actorTmp = formData.step3_equipment;

View File

@@ -121,11 +121,14 @@
} }
}, },
"Item": { "Item": {
"types": ["item", "armor", "weapon", "feat", "xp-advancement"], "types": ["item", "armor", "weapon", "feat", "quality", "xp-advancement"],
"item": { "item": {
"description": "", "description": "",
"properties": "",
"quantity": 1, "quantity": 1,
"weight": 0 "rarity": 0,
"weight": 0,
"zeni": 0
}, },
"armor": { "armor": {
"quantity": 1, "quantity": 1,
@@ -133,24 +136,40 @@
"description": "", "description": "",
"armor": { "armor": {
"physical": 0, "physical": 0,
"spiritual": 0 "supernatural": 0
}, },
"properties": "" "properties": "",
"rarity": 0,
"zeni": 0
}, },
"weapon": { "weapon": {
"quantity": 1, "category": "",
"weight": 0, "skill": "melee",
"description": "",
"damage": 0,
"range": 0, "range": 0,
"properties": "" "damage": 0,
"deadliness": 0,
"grip_1": "",
"grip_2": "",
"properties": "",
"quantity": 1,
"rarity": 0,
"weight": 0,
"zeni": 0,
"description": ""
}, },
"feat": { "feat": {
"feat_type": "", "feat_type": "",
"xp_used": 0, "xp_used": 0,
"rank": 0, "rank": 0,
"ring": "", "ring": "",
"effects": "",
"description": "" "description": ""
},
"quality": {
"description": ""
},
"xp-advancement": {
"description": "TODO"
} }
} }
} }

View File

@@ -6,11 +6,11 @@
<header class="part-header flexrow chat-profil"> <header class="part-header flexrow chat-profil">
<span class="chat-profil-element"> <span class="chat-profil-element">
<img class="profile-img" <img class="profile-img"
src="{{#if l5r5e.actor.img}}{{l5r5e.actor.img}}{{/if}}{{^if l5r5e.actor.img}}icons/svg/mystery-man.svg{{/if}}" src="{{#if l5r5e.actor.img}}{{l5r5e.actor.img}}{{else}}icons/svg/mystery-man.svg{{/if}}"
data-edit="img" data-edit="img"
height="40" height="40"
width="40" width="40"
alt="{{#if l5r5e.actor.name}}{{l5r5e.actor.name}}{{/if}}{{^if l5r5e.actor.name}}mystery-man{{/if}}" alt="{{#if l5r5e.actor.name}}{{l5r5e.actor.name}}{{else}}mystery-man{{/if}}"
> >
</span> </span>
@@ -23,8 +23,11 @@
</span> </span>
<span class="chat-profil-element"> <span class="chat-profil-element">
{{#if l5r5e.summary.difficultyHidden}}{{localize 'l5r5e.chatdices.difficulty_hidden'}}{{/if}} {{#if l5r5e.summary.difficultyHidden}}
{{^if l5r5e.summary.difficultyHidden}}{{localize 'l5r5e.chatdices.difficulty'}} {{l5r5e.summary.difficulty}}{{/if}} {{localize 'l5r5e.chatdices.difficulty_hidden'}}
{{else}}
{{localize 'l5r5e.chatdices.difficulty'}} {{l5r5e.summary.difficulty}}
{{/if}}
</span> </span>
</header> </header>
</div> </div>

View File

@@ -4,11 +4,11 @@
<tr> <tr>
<td class="profil center"> <td class="profil center">
<img class="profile-img" <img class="profile-img"
src="{{#if actor.img}}{{actor.img}}{{/if}}{{^if actor.img}}icons/svg/mystery-man.svg{{/if}}" src="{{#if actor.img}}{{actor.img}}{{else}}icons/svg/mystery-man.svg{{/if}}"
data-edit="img" data-edit="img"
height="200" height="200"
width="200" width="200"
alt="{{#if actor.name}}{{actor.name}}{{/if}}{{^if actor.name}}mystery-man{{/if}}" alt="{{#if actor.name}}{{actor.name}}{{else}}mystery-man{{/if}}"
> >
</td> </td>
<td class="rings center"> <td class="rings center">
@@ -51,8 +51,7 @@
<span class="dice-skill" type="text" name="skill_{{skillData.name}}">{{skillData.value}}</span> <span class="dice-skill" type="text" name="skill_{{skillData.name}}">{{skillData.value}}</span>
</div> </div>
</div> </div>
{{/if}} {{else}}
{{^if skillData.name}}
<img class="profile-img" <img class="profile-img"
src="systems/l5r5e/assets/imgs/noskill.png" src="systems/l5r5e/assets/imgs/noskill.png"
data-edit="img" data-edit="img"

View File

@@ -4,7 +4,7 @@
<li class="item-name">{{ item.name }}</li> <li class="item-name">{{ item.name }}</li>
<li class="icon-stat-container">{{item.data.weight}}</li> <li class="icon-stat-container">{{item.data.weight}}</li>
<li class="icon-stat-container">{{item.data.armor.physical}} <i class="fas fa-certificate"></i></li> <li class="icon-stat-container">{{item.data.armor.physical}} <i class="fas fa-certificate"></i></li>
<li class="icon-stat-container">{{item.data.armor.spiritual}} <i class="fas fa-arrows-alt-h"></i></li> <li class="icon-stat-container">{{item.data.armor.supernatural}} <i class="fas fa-arrows-alt-h"></i></li>
<li class="item-edit" title="Edit Feat"><i class="fas fa-edit"></i></li> <li class="item-edit" title="Edit Feat"><i class="fas fa-edit"></i></li>
<li class="item-delete" title="Delete Feat"><i class="fas fa-trash"></i></li> <li class="item-delete" title="Delete Feat"><i class="fas fa-trash"></i></li>
</ul> </ul>

View File

@@ -12,6 +12,17 @@
<input type="text" name="data.weight" value="{{data.weight}}" data-dtype="Number"/> <input type="text" name="data.weight" value="{{data.weight}}" data-dtype="Number"/>
</div> </div>
</div> </div>
<div class="header-fields">
<div class="resource">
<label>{{ localize 'l5r5e.rarity' }}</label>
<input type="text" name="data.rarity" value="{{data.rarity}}" data-dtype="Number"/>
</div>
<div class="resource">
<label>{{ localize 'l5r5e.zeni' }}</label>
<input type="text" name="data.zeni" value="{{data.zeni}}" data-dtype="Number"/>
</div>
</div>
</header> </header>
{{!-- Sheet Body --}} {{!-- Sheet Body --}}
<section class="sheet-body"> <section class="sheet-body">
@@ -21,17 +32,23 @@
</nav> </nav>
{{!-- Description Tab --}} {{!-- Description Tab --}}
<article class="tab" data-group="primary" data-tab="description"> <article class="tab" data-group="primary" data-tab="description">
{{ localize 'l5r5e.armors.title' }} <fieldset>
<legend class="text-block-header">{{ localize 'l5r5e.description' }}</legend>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</fieldset>
<fieldset class="weapon-stats-content"> <fieldset class="weapon-stats-content">
{{ localize 'l5r5e.armors.title' }}
<label class="attribute-label"> <label class="attribute-label">
{{ localize 'l5r5e.armors.physical' }} {{ localize 'l5r5e.armors.physical' }}
<input type="text" name="data.armor.physical" value="{{data.armor.physical}}" data-dtype="Number" placeholder="0"/> <input type="text" name="data.armor.physical" value="{{data.armor.physical}}" data-dtype="Number" placeholder="0"/>
</label> </label>
<label class="attribute-label"> <label class="attribute-label">
{{ localize 'l5r5e.armors.spiritual' }} {{ localize 'l5r5e.armors.supernatural' }}
<input type="text" name="data.armor.spiritual" value="{{data.armor.spiritual}}" data-dtype="Number" placeholder="0"/> <input type="text" name="data.armor.supernatural" value="{{data.armor.supernatural}}" data-dtype="Number" placeholder="0"/>
</label> </label>
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend class="text-block-header">{{ localize 'l5r5e.properties' }}</legend> <legend class="text-block-header">{{ localize 'l5r5e.properties' }}</legend>
{{editor content=data.properties target="data.properties" button=true owner=owner editable=editable}} {{editor content=data.properties target="data.properties" button=true owner=owner editable=editable}}

View File

@@ -6,4 +6,5 @@
<li class="item-delete" title="Delete Feat"><i class="fas fa-trash"></i></li> <li class="item-delete" title="Delete Feat"><i class="fas fa-trash"></i></li>
</ul> </ul>
<div class="item-description">{{{ feat.data.description }}}</div> <div class="item-description">{{{ feat.data.description }}}</div>
<div class="item-properties">{{{ feat.data.properties }}}</div>
</li> </li>

View File

@@ -12,6 +12,17 @@
<input type="text" name="data.weight" value="{{data.weight}}" data-dtype="Number"/> <input type="text" name="data.weight" value="{{data.weight}}" data-dtype="Number"/>
</div> </div>
</div> </div>
<div class="header-fields">
<div class="resource">
<label>{{ localize 'l5r5e.rarity' }}</label>
<input type="text" name="data.rarity" value="{{data.rarity}}" data-dtype="Number"/>
</div>
<div class="resource">
<label>{{ localize 'l5r5e.zeni' }}</label>
<input type="text" name="data.zeni" value="{{data.zeni}}" data-dtype="Number"/>
</div>
</div>
</header> </header>
{{!-- Sheet Body --}} {{!-- Sheet Body --}}
<section class="sheet-body"> <section class="sheet-body">

View File

@@ -0,0 +1,10 @@
<fieldset class="weapons-content">
<legend class="section-header">{{ localize 'l5r5e.quality' }}</legend>
<ul class="item-list">
{{#each actor.items as |item id|}}
{{#if item.isQuality }}
{{> 'systems/l5r5e/templates/item/quality-entry.html' item=item id=id }}
{{/if}}
{{/each}}
</ul>
</fieldset>

View File

@@ -0,0 +1,9 @@
<li class="item flexcol" data-item-id="{{item._id}}">
<ul class="item-header item-control">
<li class="item-img"><img src="{{item.img}}" title="{{item.name}}" width="32px" height="32px"/></li>
<li class="item-name">{{ item.name }}</li>
<li class="item-edit" title="Edit Feat"><i class="fas fa-edit"></i></li>
<li class="item-delete" title="Delete Feat"><i class="fas fa-trash"></i></li>
</ul>
<div class="item-description">{{{ item.data.description }}}</div>
</li>

View File

@@ -0,0 +1,22 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="description">Description</a>
</nav>
{{!-- Description Tab --}}
<article class="tab" data-group="primary" data-tab="description">
<fieldset>
<legend class="text-block-header">{{ localize 'l5r5e.description' }}</legend>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</fieldset>
</article>
</section>
</form>

View File

@@ -12,6 +12,34 @@
<input type="text" name="data.weight" value="{{data.weight}}" data-dtype="Number"/> <input type="text" name="data.weight" value="{{data.weight}}" data-dtype="Number"/>
</div> </div>
</div> </div>
<div class="header-fields">
<div class="resource">
<label>{{ localize 'l5r5e.category' }}</label>
<input type="text" name="data.category" value="{{data.category}}" />
</div>
<div class="resource">
<label>{{ localize 'l5r5e.skill' }}</label>
<select class="attribute-dtype" name="data.skill">
{{#select data.skill}}
{{#each data.skills as |id cat|}}
<option value="{{id}}">{{localizeSkillId id}}</option>
{{/each}}
{{/select}}
</select>
</div>
</div>
<div class="header-fields">
<div class="resource">
<label>{{ localize 'l5r5e.rarity' }}</label>
<input type="text" name="data.rarity" value="{{data.rarity}}" data-dtype="Number"/>
</div>
<div class="resource">
<label>{{ localize 'l5r5e.zeni' }}</label>
<input type="text" name="data.zeni" value="{{data.zeni}}" data-dtype="Number"/>
</div>
</div>
</header> </header>
{{!-- Sheet Body --}} {{!-- Sheet Body --}}
<section class="sheet-body"> <section class="sheet-body">
@@ -31,10 +59,25 @@
<input type="text" name="data.range" value="{{data.range}}" data-dtype="Number" placeholder="0"/> <input type="text" name="data.range" value="{{data.range}}" data-dtype="Number" placeholder="0"/>
</label> </label>
</fieldset> </fieldset>
<fieldset class="weapon-stats-content">
<label class="attribute-label">
{{ localize 'l5r5e.deadliness' }}
<input type="text" name="data.deadliness" value="{{data.deadliness}}" data-dtype="Number" placeholder="0"/>
</label>
<label class="attribute-label">
{{ localize 'l5r5e.grips' }}
<input type="text" name="data.grip_1" value="{{data.grip_1}}" />
<input type="text" name="data.grip_2" value="{{data.grip_2}}" />
</label>
</fieldset>
<fieldset> <fieldset>
<legend class="text-block-header">{{ localize 'l5r5e.properties' }}</legend> <legend class="text-block-header">{{ localize 'l5r5e.properties' }}</legend>
{{editor content=data.properties target="data.properties" button=true owner=owner editable=editable}} {{editor content=data.properties target="data.properties" button=true owner=owner editable=editable}}
</fieldset> </fieldset>
<fieldset>
<legend class="text-block-header">{{ localize 'l5r5e.description' }}</legend>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</fieldset>
</article> </article>
</section> </section>
</form> </form>

View File

@@ -43,6 +43,7 @@
<article class="tab conflict" data-group="primary" data-tab="conflict"> <article class="tab conflict" data-group="primary" data-tab="conflict">
{{> 'systems/l5r5e/templates/sheets/actor/conflict.html' }} {{> 'systems/l5r5e/templates/sheets/actor/conflict.html' }}
{{> 'systems/l5r5e/templates/item/weapons.html' }} {{> 'systems/l5r5e/templates/item/weapons.html' }}
{{> 'systems/l5r5e/templates/item/armors.html' }}
</article> </article>
<article class="tab inventory" data-group="primary" data-tab="inventory"> <article class="tab inventory" data-group="primary" data-tab="inventory">

View File

@@ -1,7 +1,7 @@
<div class="feats-wrapper"> <div class="feats-wrapper">
<fieldset class="section-header flexrow"> <fieldset class="section-header flexrow">
<legend class="feat-controls"> <legend class="feat-controls">
{{ localize 'l5r5e.feats' }} {{ localize 'l5r5e.feats.title' }}
<a class="feat-control feat-add" title="Add Item"><i class="fas fa-plus"></i></a> <a class="feat-control feat-add" title="Add Item"><i class="fas fa-plus"></i></a>
</legend> </legend>
<ul class="item-list"> <ul class="item-list">

View File

@@ -81,7 +81,6 @@
{{!-- Sheet Body --}} {{!-- Sheet Body --}}
<section class="sheet-body"> <section class="sheet-body">
{{!-- Skills Tab --}} {{!-- Skills Tab --}}
<article class="tab skills" data-group="primary" data-tab="skills"> <article class="tab skills" data-group="primary" data-tab="skills">
<ul class="skills-wrapper"> <ul class="skills-wrapper">
@@ -99,7 +98,7 @@
{{> 'systems/l5r5e/templates/item/weapons.html' }} {{> 'systems/l5r5e/templates/item/weapons.html' }}
{{> 'systems/l5r5e/templates/item/armor.html' }} {{> 'systems/l5r5e/templates/item/armors.html' }}
</section> </section>
</form> </form>

View File

@@ -2,7 +2,7 @@
<!--TODO Localization !--> <!--TODO Localization !-->
<h1>Vingt questions</h1> <h1>{{localize 'l5r5e.twenty_questions.title'}}</h1>
<div> <div>
Renseignez vos réponses au jeu des vingt questions sur ce formulaire et notez-y des éléments à utiliser Renseignez vos réponses au jeu des vingt questions sur ce formulaire et notez-y des éléments à utiliser
ultérieurement ! ultérieurement !
@@ -10,7 +10,7 @@
</div> </div>
<h2>Partie I: Identité (clan et famille)</h2> <h2>{{localize 'l5r5e.twenty_questions.part1.title'}}</h2>
<div> <div>
1. A quel clan appartient votre personnage ? (p. 41) 1. A quel clan appartient votre personnage ? (p. 41)
<input type="text" name="step1_clan" value="{{actor.identity.clan}}"> <input type="text" name="step1_clan" value="{{actor.identity.clan}}">
@@ -100,7 +100,7 @@
</div> </div>
<h2>Partie II: Rôle et École</h2> <h2>{{localize 'l5r5e.twenty_questions.part2.title'}}</h2>
<div> <div>
3. Quelle est l'École votre personnage, et quel rôle remplit-elle ? (p. 56) 3. Quelle est l'École votre personnage, et quel rôle remplit-elle ? (p. 56)
@@ -186,27 +186,11 @@
<!--TODO in feat or props ? --> <!--TODO in feat or props ? -->
Types de techniques accessibles Types de techniques accessibles
<div> <div>
{{localizeFeat 'title'}}
{{#each featsList as |feat|}}
<label><input type="checkbox" name="step3_feat_{{feat}}">{{localizeFeat feat}}</label>
{{/each}}
<label> <label>
<input type="checkbox" name="step3_tech_kata">Kata
</label>
<label>
<input type="checkbox" name="step3_tech_kiho">Kihō
</label>
<label>
<input type="checkbox" name="step3_tech_invocations">Invocations
</label>
<label>
<input type="checkbox" name="step3_tech_rituals">Rituels
</label>
<label>
<input type="checkbox" name="step3_tech_shuji">Shūji
</label>
<label>
<input type="checkbox" name="step3_tech_maho">Mahō
</label>
<label>
<input type="checkbox" name="step3_tech_ninjutsu">Ninjutsu
</label>
</div> </div>
<div> <div>
@@ -246,7 +230,7 @@
</div> </div>
<h2>Partie III: Honneur et Gloire</h2> <h2>{{localize 'l5r5e.twenty_questions.part3.title'}}</h2>
<div> <div>
5. Qui est le seigneur de votre personnage et quel est le devoir de votre personnage envers lui ? (p. 88) 5. Qui est le seigneur de votre personnage et quel est le devoir de votre personnage envers lui ? (p. 88)
Choisissez un giri: Choisissez un giri:
@@ -309,7 +293,7 @@
</div> </div>
<h3>Partie IV: Forces et Faiblesses</h3> <h2>{{localize 'l5r5e.twenty_questions.part4.title'}}</h2>
<div> <div>
9. Quelle est à ce jour la plus belle réussite de votre personnage ? (p. 92) 9. Quelle est à ce jour la plus belle réussite de votre personnage ? (p. 92)
<textarea name="step9_success"></textarea> <textarea name="step9_success"></textarea>
@@ -366,7 +350,7 @@
</div> </div>
<h3>Partie V: Personnalité et Comportement</h3> <h2>{{localize 'l5r5e.twenty_questions.part5.title'}}</h2>
<div> <div>
14. Que remarque-t-on en premier chez votre personnage ? (p. 93) 14. Que remarque-t-on en premier chez votre personnage ? (p. 93)
<textarea name="step14_first_sight"></textarea> <textarea name="step14_first_sight"></textarea>
@@ -388,7 +372,7 @@
</div> </div>
<h3>Partie VI: Lignée et Famille</h3> <h2>{{localize 'l5r5e.twenty_questions.part6.title'}}</h2>
<div> <div>
17. Comment les parents de votre personnage le décriraient-ils ? (p. 95) 17. Comment les parents de votre personnage le décriraient-ils ? (p. 95)
<textarea name="step17_parents_pov"></textarea> <textarea name="step17_parents_pov"></textarea>
@@ -424,7 +408,7 @@
<textarea name="step19_firstname"></textarea> <textarea name="step19_firstname"></textarea>
</div> </div>
<h3>Partie VII: Mort</h3> <h2>{{localize 'l5r5e.twenty_questions.part7.title'}}</h2>
<div> <div>
20. Comment envisagez-vous la mort de votre personnage ? (p. 95) 20. Comment envisagez-vous la mort de votre personnage ? (p. 95)
<textarea name="step20_death"></textarea> <textarea name="step20_death"></textarea>