standardization pass

This commit is contained in:
Vlyan
2020-12-18 16:31:03 +01:00
parent 9893ca4223
commit 003bcc1761
65 changed files with 131 additions and 149 deletions

View File

@@ -4,11 +4,11 @@ import { TwentyQuestionsDialog } from "./twenty-questions-dialog.js";
/**
* Actor / Character Sheet
*/
export class ActorSheetL5r5e extends BaseSheetL5r5e {
export class CharacterSheetL5r5e extends BaseSheetL5r5e {
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["l5r5e", "sheet", "actor"],
template: CONFIG.l5r5e.paths.templates + "sheets/actor-sheet.html",
template: CONFIG.l5r5e.paths.templates + "actors/character-sheet.html",
width: 600,
height: 800,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],
@@ -56,7 +56,7 @@ export class ActorSheetL5r5e extends BaseSheetL5r5e {
*/
getXpSpentInThisRank() {
const currentRank = this.actor.data.data.identity.school_rank || 0;
const spent = this.actor.items.reduce((tot, item) => {
return this.actor.items.reduce((tot, item) => {
// TODO c'est bien par rang actuel +1 ?
if (currentRank + 1 === item.data.data.rank) {
let xp = item.data.data.xp_used || 0;
@@ -69,6 +69,5 @@ export class ActorSheetL5r5e extends BaseSheetL5r5e {
}
return tot;
}, 0);
return spent;
}
}

View File

@@ -9,7 +9,7 @@ export class NpcSheetL5r5e extends BaseSheetL5r5e {
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["l5r5e", "sheet", "npc"],
template: CONFIG.l5r5e.paths.templates + "sheets/npc-sheet.html",
template: CONFIG.l5r5e.paths.templates + "actors/npc-sheet.html",
width: 600,
height: 800,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],

View File

@@ -1,4 +1,4 @@
import { L5R5E } from "../config-l5r5e.js";
import { L5R5E } from "../config.js";
/**
* L5R Twenty Questions form
@@ -24,7 +24,7 @@ export class TwentyQuestionsDialog extends FormApplication {
return mergeObject(super.defaultOptions, {
id: "l5r5e-twenty-questions-dialog",
classes: ["l5r5e", "twenty-questions-dialog"],
template: CONFIG.l5r5e.paths.templates + "sheets/twenty-questions-dialog.html",
template: CONFIG.l5r5e.paths.templates + "actors/twenty-questions-dialog.html",
title: game.i18n.localize("l5r5e.twenty_questions.title"),
width: 600,
height: 600,

View File

@@ -1,23 +0,0 @@
/**
* Establish each L5r5e dice type here as extensions of DiceTerm.
* @extends {DiceTerm}
*/
export { L5rBaseDie } from "./dice/dietype/l5r-base-die.js";
export { AbilityDie } from "./dice/dietype/ability-die.js";
export { RingDie } from "./dice/dietype/ring-die.js";
/**
* New extension of the core DicePool class for evaluating rolls with the L5r5e DiceTerms
*/
export { RollL5r5e } from "./dice/roll.js";
/**
* Dice pool utility specializing in the L5r5e special dice
*/
export { DicePoolL5r5e } from "./dice/pool.js";
/**
* Dice Picker Dialog
*/
export { DicePickerDialog } from "./dice/dice-picker-dialog.js";

View File

@@ -2,7 +2,7 @@
* L5R Dice picker dialog
* @extends {FormApplication}
*/
import { L5R5E } from "../config-l5r5e.js";
import { L5R5E } from "../config.js";
import { RollL5r5e } from "./roll.js";
export class DicePickerDialog extends FormApplication {

View File

@@ -1,4 +1,4 @@
import { L5R5E } from "../config-l5r5e.js";
import { L5R5E } from "../config.js";
import { L5rBaseDie } from "./dietype/l5r-base-die.js";
/**

View File

@@ -1,4 +1,4 @@
import { L5R5E } from "./config-l5r5e.js";
import { L5R5E } from "./config.js";
/**
* Extends the actor to process special things from L5R.
@@ -8,7 +8,7 @@ export class HelpersL5r5e {
* Get Rings/Element for List / Select
*/
static getRingsList() {
return L5R5E.stances.map((e) => {
return CONFIG.l5r5e.stances.map((e) => {
return {
id: e,
label: game.i18n.localize(`l5r5e.rings.${e}`),
@@ -31,7 +31,7 @@ export class HelpersL5r5e {
}
const skills = {};
Array.from(L5R5E.skills).forEach(([id, cat]) => {
Array.from(CONFIG.l5r5e.skills).forEach(([id, cat]) => {
if (!skills[cat]) {
skills[cat] = [];
}
@@ -48,7 +48,7 @@ export class HelpersL5r5e {
* Get Techniques for List / Select
*/
static getTechniquesList() {
return L5R5E.techniques.map((e) => {
return CONFIG.l5r5e.techniques.map((e) => {
return {
id: e,
label: game.i18n.localize(`l5r5e.techniques.${e}`),

View File

@@ -13,7 +13,7 @@ export class AdvancementSheetL5r5e extends ItemSheetL5r5e {
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["l5r5e", "sheet", "advancement"],
template: CONFIG.l5r5e.paths.templates + "item/advancement-sheet.html",
template: CONFIG.l5r5e.paths.templates + "items/advancement/advancement-sheet.html",
width: 520,
height: 480,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],

View File

@@ -8,7 +8,7 @@ export class ArmorSheetL5r5e extends ItemSheetL5r5e {
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["l5r5e", "sheet", "armor"],
template: CONFIG.l5r5e.paths.templates + "item/armor-sheet.html",
template: CONFIG.l5r5e.paths.templates + "items/armor/armor-sheet.html",
width: 520,
height: 480,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],

View File

@@ -7,7 +7,7 @@ export class ItemSheetL5r5e extends ItemSheet {
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["l5r5e", "sheet", "item"],
template: CONFIG.l5r5e.paths.templates + "item/item-sheet.html",
template: CONFIG.l5r5e.paths.templates + "items/item/item-sheet.html",
width: 520,
height: 480,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],

View File

@@ -14,7 +14,7 @@ export class PeculiaritySheetL5r5e extends ItemSheetL5r5e {
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["l5r5e", "sheet", "peculiarity"],
template: CONFIG.l5r5e.paths.templates + "item/peculiarity-sheet.html",
template: CONFIG.l5r5e.paths.templates + "items/peculiarity/peculiarity-sheet.html",
width: 520,
height: 480,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],

View File

@@ -3,12 +3,12 @@ import { ItemSheetL5r5e } from "./item-sheet.js";
/**
* @extends {ItemSheet}
*/
export class QualitySheetL5r5e extends ItemSheetL5r5e {
export class PropertySheetL5r5e extends ItemSheetL5r5e {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["l5r5e", "sheet", "quality"],
template: CONFIG.l5r5e.paths.templates + "item/quality-sheet.html",
classes: ["l5r5e", "sheet", "property"],
template: CONFIG.l5r5e.paths.templates + "items/property/property-sheet.html",
width: 520,
height: 480,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],

View File

@@ -8,7 +8,7 @@ export class TechniqueSheetL5r5e extends ItemSheetL5r5e {
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["l5r5e", "sheet", "technique"],
template: CONFIG.l5r5e.paths.templates + "item/technique-sheet.html",
template: CONFIG.l5r5e.paths.templates + "items/technique/technique-sheet.html",
width: 520,
height: 480,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],

View File

@@ -1,4 +1,4 @@
import { L5R5E } from "../config-l5r5e.js";
import { L5R5E } from "../config.js";
import { ItemSheetL5r5e } from "./item-sheet.js";
/**
@@ -9,7 +9,7 @@ export class WeaponSheetL5r5e extends ItemSheetL5r5e {
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["l5r5e", "sheet", "weapon"],
template: CONFIG.l5r5e.paths.templates + "item/weapon-sheet.html",
template: CONFIG.l5r5e.paths.templates + "items/weapon/weapon-sheet.html",
width: 520,
height: 480,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],

View File

@@ -1,23 +1,27 @@
// Import Modules
import { L5R5E } from "./config-l5r5e.js";
import { HelpersL5r5e } from "./helpers-l5r5e.js";
// Import Commons Modules
import { L5R5E } from "./config.js";
import { HelpersL5r5e } from "./helpers.js";
import { RegisterSettings } from "./settings.js";
import { PreloadTemplates } from "./preloadTemplates.js";
import { ActorL5r5e } from "./actor-l5r5e.js";
import { ActorSheetL5r5e } from "./sheets/actor-sheet.js";
import { NpcSheetL5r5e } from "./sheets/npc-sheet.js";
import { RollL5r5e, AbilityDie, RingDie, DicePickerDialog } from "./dice-l5r5e.js";
// Actors
import { ActorL5r5e } from "./actor.js";
import { CharacterSheetL5r5e } from "./actors/character-sheet.js";
import { NpcSheetL5r5e } from "./actors/npc-sheet.js";
// Dice and rolls
import { AbilityDie } from "./dice/dietype/ability-die.js";
import { RingDie } from "./dice/dietype/ring-die.js";
import { RollL5r5e } from "./dice/roll.js";
import { DicePickerDialog } from "./dice/dice-picker-dialog.js";
// Items
import { ItemL5r5e } from "./items/item.js";
import { ItemSheetL5r5e } from "./items/item-sheet.js";
import { ArmorSheetL5r5e } from "./items/armor-sheet.js";
import { WeaponSheetL5r5e } from "./items/weapon-sheet.js";
import { TechniqueSheetL5r5e } from "./items/technique-sheet.js";
import { QualitySheetL5r5e } from "./items/quality-sheet.js";
import { PropertySheetL5r5e } from "./items/property-sheet.js";
import { AdvancementSheetL5r5e } from "./items/advancement-sheet.js";
import { PeculiaritySheetL5r5e } from "./items/peculiarity-sheet.js";
// Import Dice Types
/* ------------------------------------ */
/* Initialize system */
/* ------------------------------------ */
@@ -37,7 +41,7 @@ Hooks.once("init", async function () {
// Assign custom classes and constants here
CONFIG.Actor.entityClass = ActorL5r5e;
CONFIG.Actor.sheetClasses = ActorSheetL5r5e;
CONFIG.Actor.sheetClasses = CharacterSheetL5r5e;
CONFIG.Item.entityClass = ItemL5r5e;
// Define custom Roll class
@@ -63,7 +67,7 @@ Hooks.once("init", async function () {
// Register custom sheets (if any)
// Actors sheet
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("l5r5e", ActorSheetL5r5e, { types: ["character"], makeDefault: true });
Actors.registerSheet("l5r5e", CharacterSheetL5r5e, { types: ["character"], makeDefault: true });
Actors.registerSheet("l5r5e", NpcSheetL5r5e, { types: ["npc"], makeDefault: false });
// Items sheet
@@ -72,7 +76,7 @@ Hooks.once("init", async function () {
Items.registerSheet("l5r5e", ArmorSheetL5r5e, { types: ["armor"], makeDefault: true });
Items.registerSheet("l5r5e", WeaponSheetL5r5e, { types: ["weapon"], makeDefault: true });
Items.registerSheet("l5r5e", TechniqueSheetL5r5e, { types: ["technique"], makeDefault: true });
Items.registerSheet("l5r5e", QualitySheetL5r5e, { types: ["quality"], makeDefault: true });
Items.registerSheet("l5r5e", PropertySheetL5r5e, { types: ["property"], makeDefault: true });
Items.registerSheet("l5r5e", PeculiaritySheetL5r5e, { types: ["peculiarity"], makeDefault: true });
Items.registerSheet("l5r5e", AdvancementSheetL5r5e, { types: ["advancement"], makeDefault: true });

View File

@@ -1,46 +1,48 @@
export const PreloadTemplates = async function () {
const templatePaths = [
// Add paths to "systems/l5r5e/templates"
// actor
"systems/l5r5e/templates/sheets/actor/rings.html",
"systems/l5r5e/templates/sheets/actor/narrative.html",
"systems/l5r5e/templates/sheets/actor/identity.html",
"systems/l5r5e/templates/sheets/actor/category.html",
"systems/l5r5e/templates/sheets/actor/skill.html",
"systems/l5r5e/templates/sheets/actor/social.html",
"systems/l5r5e/templates/sheets/actor/attributes.html",
"systems/l5r5e/templates/sheets/actor/conflict.html",
"systems/l5r5e/templates/sheets/actor/stance.html",
"systems/l5r5e/templates/sheets/actor/techniques.html",
"systems/l5r5e/templates/sheets/actor/experience.html",
"systems/l5r5e/templates/sheets/actor/advancement.html",
// actors
"systems/l5r5e/templates/actors/character/rings.html",
"systems/l5r5e/templates/actors/character/narrative.html",
"systems/l5r5e/templates/actors/character/identity.html",
"systems/l5r5e/templates/actors/character/category.html",
"systems/l5r5e/templates/actors/character/skill.html",
"systems/l5r5e/templates/actors/character/social.html",
"systems/l5r5e/templates/actors/character/attributes.html",
"systems/l5r5e/templates/actors/character/conflict.html",
"systems/l5r5e/templates/actors/character/stance.html",
"systems/l5r5e/templates/actors/character/techniques.html",
"systems/l5r5e/templates/actors/character/experience.html",
"systems/l5r5e/templates/actors/character/advancement.html",
// npc
"systems/l5r5e/templates/sheets/npc/identity.html",
"systems/l5r5e/templates/sheets/npc/narrative.html",
"systems/l5r5e/templates/sheets/npc/social.html",
"systems/l5r5e/templates/sheets/npc/rings.html",
"systems/l5r5e/templates/sheets/npc/attributes.html",
"systems/l5r5e/templates/sheets/npc/skill.html",
"systems/l5r5e/templates/sheets/npc/techniques.html",
"systems/l5r5e/templates/actors/npc/identity.html",
"systems/l5r5e/templates/actors/npc/narrative.html",
"systems/l5r5e/templates/actors/npc/social.html",
"systems/l5r5e/templates/actors/npc/rings.html",
"systems/l5r5e/templates/actors/npc/attributes.html",
"systems/l5r5e/templates/actors/npc/skill.html",
"systems/l5r5e/templates/actors/npc/techniques.html",
// items
"systems/l5r5e/templates/item/weapon-sheet.html",
"systems/l5r5e/templates/item/items.html",
"systems/l5r5e/templates/item/item-entry.html",
"systems/l5r5e/templates/item/weapons.html",
"systems/l5r5e/templates/item/weapon-entry.html",
"systems/l5r5e/templates/item/armors.html",
"systems/l5r5e/templates/item/armor-entry.html",
"systems/l5r5e/templates/item/technique-sheet.html",
"systems/l5r5e/templates/item/technique-entry.html",
"systems/l5r5e/templates/item/qualities.html",
"systems/l5r5e/templates/item/quality-sheet.html",
"systems/l5r5e/templates/item/quality-entry.html",
"systems/l5r5e/templates/item/advancements.html",
"systems/l5r5e/templates/item/advancement-sheet.html",
"systems/l5r5e/templates/item/advancement-entry.html",
"systems/l5r5e/templates/item/peculiarities.html",
"systems/l5r5e/templates/item/peculiarity-sheet.html",
"systems/l5r5e/templates/item/peculiarity-entry.html",
"systems/l5r5e/templates/items/advancement/advancements.html",
"systems/l5r5e/templates/items/advancement/advancement-entry.html",
"systems/l5r5e/templates/items/advancement/advancement-sheet.html",
"systems/l5r5e/templates/items/armor/armors.html",
"systems/l5r5e/templates/items/armor/armor-entry.html",
"systems/l5r5e/templates/items/armor/armor-sheet.html",
"systems/l5r5e/templates/items/item/items.html",
"systems/l5r5e/templates/items/item/item-entry.html",
"systems/l5r5e/templates/items/item/item-sheet.html",
"systems/l5r5e/templates/items/peculiarity/peculiarities.html",
"systems/l5r5e/templates/items/peculiarity/peculiarity-entry.html",
"systems/l5r5e/templates/items/peculiarity/peculiarity-sheet.html",
"systems/l5r5e/templates/items/property/properties.html",
"systems/l5r5e/templates/items/property/property-entry.html",
"systems/l5r5e/templates/items/property/property-sheet.html",
"systems/l5r5e/templates/items/technique/technique-entry.html",
"systems/l5r5e/templates/items/technique/technique-sheet.html",
"systems/l5r5e/templates/items/weapon/weapons.html",
"systems/l5r5e/templates/items/weapon/weapon-entry.html",
"systems/l5r5e/templates/items/weapon/weapon-sheet.html",
];
return loadTemplates(templatePaths);