diff --git a/README.md b/README.md index 8a0ffb5..e886bf5 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,9 @@ # Vaarn - **Author**: Omniczech with heavy reliance on Rabid Baboon's Knave system -- **Foundry VTT Compatibility**: v10 +- **Foundry VTT Compatibility**: v12 - **Translation Support**: None -### Foundry VTT Compatibility v9 - -- Use this manifest - # Features - Attack and damage rolls from character inventory, with target support diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index c3aad4e..ace1149 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -4,13 +4,13 @@ import { alternateRolls } from "../settings.js"; * Extend the basic ActorSheet with some very simple modifications * @extends {ActorSheet} */ -export class KnaveActorSheet extends ActorSheet { +export class VaarnActorSheet extends ActorSheet { #_hitTargets = new Set(); /** @override */ static get defaultOptions() { - return mergeObject(super.defaultOptions, { - classes: ["knave", "sheet", "actor"], + return foundry.utils.mergeObject(super.defaultOptions, { + classes: ["vaarn", "sheet", "actor"], template: "systems/vaultsofvaarn/templates/actor/actor-sheet.html", width: 1000, height: 620, @@ -18,19 +18,18 @@ export class KnaveActorSheet extends ActorSheet { { navSelector: ".description-tabs", contentSelector: ".description-tabs-content", - initial: "description", - }, - ], + initial: "description" + } + ] }); } /* -------------------------------------------- */ /** @override */ - - getData() { - let sheet = super.getData(); - return sheet; + async getData() { + const context = super.getData(); + return context; } /** @override */ @@ -41,27 +40,27 @@ export class KnaveActorSheet extends ActorSheet { if (!this.options.editable) return; // Add Inventory Item - html.find(".item-create").click(this._onItemCreate.bind(this)); + html.on('click', '.item-create', this._onItemCreate.bind(this)); //ability button clicked - html.find(".knave-ability-button").click((ev) => { + html.on('click', ".vaarn-ability-button", (ev) => { this._onAbility_Clicked($(ev.currentTarget)[0].id); }); - html.find(".knave-morale-button").click(this._onMoraleCheck.bind(this)); - html.find(".knave-armor-button").click(this._onArmorCheck.bind(this)); - html.find(".knave-short-rest-button").click(this._shortRest.bind(this)); - html.find(".knave-long-rest-button").click(this._longRest.bind(this)); - html.find(".knave-wounded-button").click(this._wounded.bind(this)); + html.on('click', '.vaarn-morale-button', this._onMoraleCheck.bind(this)); + html.on('click', ".vaarn-armor-button", this._onArmorCheck.bind(this)); + html.on('click', ".vaarn-short-rest-button", this._shortRest.bind(this)); + html.on('click', ".vaarn-long-rest-button", this._longRest.bind(this)); + html.on('click', ".vaarn-wounded-button", this._wounded.bind(this)); // Update Inventory Item - html.find(".item-edit").click((ev) => { + html.on('click', ".item-edit", (ev) => { const li = $(ev.currentTarget).parents(".item"); const item = this.actor.items.get(li.data("itemId")); item.sheet.render(true); }); // Delete Inventory Item - html.find(".item-delete").click((ev) => { + html.on('click', ".item-delete", (ev) => { const button = ev.currentTarget; const li = button.closest(".item"); const item = this.actor.items.get(li?.dataset.itemId); @@ -69,18 +68,18 @@ export class KnaveActorSheet extends ActorSheet { }); //inventory weapon rolls - html.find(".item-roll").click((ev) => { + html.on('click', ".item-roll", (ev) => { const li = $(ev.currentTarget).parents(".item"); const item = this.actor.items.get(li.data("itemId")); this._onItemRoll(item, ev.currentTarget); }); - html.find(".item-control.item-add").click((ev) => { + html.on('click', ".item-control.item-add", (ev) => { const button = ev.currentTarget; const li = button.closest(".item"); const item = this.actor.items.get(li?.dataset.itemId); item.update({ ["data.quantity"]: item.system.quantity + 1 }); }); - html.find(".item-control.item-remove").click((ev) => { + html.on('click', ".item-control.item-remove", (ev) => { const button = ev.currentTarget; const li = button.closest(".item"); const item = this.actor.items.get(li?.dataset.itemId); @@ -108,7 +107,7 @@ export class KnaveActorSheet extends ActorSheet { const itemData = { name: name, type: type, - data: data, + data: data }; // Remove the type from the dataset since it's in the itemData.type prop. delete itemData.data["type"]; @@ -117,7 +116,7 @@ export class KnaveActorSheet extends ActorSheet { return cls.create(itemData, { parent: this.actor }); } - _onAbility_Clicked(ability, additional = null) { + async _onAbility_Clicked(ability, additional = null) { let score = 0; let name = ""; var diceToRoll = alternateRolls() ? "2d10" : "1d20"; @@ -160,17 +159,18 @@ export class KnaveActorSheet extends ActorSheet { } let formula = `${diceToRoll}+${score}`; + console.log(formula); let r = new Roll(formula); - r.evaluate({ async: false }); + await r.evaluate(); let returnCode = 0; let messageHeader = "" + name + ""; if (r.dice[0].total <= critFail) messageHeader += - ' - CRITICAL FAILURE!'; + ' - CRITICAL FAILURE!'; else if (r.dice[0].total >= critSuccess) messageHeader += - ' - CRITICAL SUCCESS!'; + ' - CRITICAL SUCCESS!'; r.toMessage({ speaker: ChatMessage.getSpeaker({ actor: this.actor }), @@ -186,39 +186,39 @@ export class KnaveActorSheet extends ActorSheet { console.log(event); } - _onMoraleCheck(event) { + async _onMoraleCheck(event) { event.preventDefault(); let r = new Roll(`2d6`); - r.evaluate({ async: false }); + await r.evaluate(); let messageHeader = ""; if (r.dice[0].total > this.object.system.morale.value) messageHeader += - 'Is fleeing'; + 'Is fleeing'; else messageHeader += - 'Is staying'; + 'Is staying'; r.toMessage({ flavor: messageHeader }); } - _onArmorCheck(event) { + async _onArmorCheck(event) { let name = "ARMOR"; let score = this.object.system.armor.bonus; event.preventDefault(); let formula = `1d20+${score}`; let r = new Roll(formula); - r.evaluate({ async: false }); + await r.evaluate(); let returnCode = 0; let messageHeader = "" + name + ""; if (r.dice[0].total === 1) messageHeader += - ' - CRITICAL FAILURE!'; + ' - CRITICAL FAILURE!'; else if (r.dice[0].total === 20) messageHeader += - ' - CRITICAL SUCCESS!'; + ' - CRITICAL SUCCESS!'; r.toMessage({ speaker: ChatMessage.getSpeaker({ actor: this.actor }), @@ -227,7 +227,7 @@ export class KnaveActorSheet extends ActorSheet { return r; } - _onItemRoll(item, eventTarget) { + async _onItemRoll(item, eventTarget) { if (eventTarget.title === "attack") { if (item.type === "weaponMelee") { const roll = this._onAbility_Clicked( @@ -241,7 +241,7 @@ export class KnaveActorSheet extends ActorSheet { } } else if (eventTarget.title === "damage") { let r = new Roll(item.system.damageDice); - r.evaluate({ async: false }); + await r.evaluate(); let messageHeader = "" + item.name + " damage"; r.toMessage({ speaker: ChatMessage.getSpeaker({ actor: this.actor }), @@ -318,11 +318,11 @@ export class KnaveActorSheet extends ActorSheet { token.actor.update({ "system.health.value": newHP }); } - _shortRest(event) { + async _shortRest(event) { const conBonus = this.object.system.abilities.con.value; let formula = `1d8+${conBonus}`; let r = new Roll(formula); - r.evaluate({ async: false }); + await r.evaluate(); this.object.update({ "system.health.value": r.total + this.object.system.health.value, }); @@ -371,7 +371,7 @@ export class KnaveActorSheet extends ActorSheet { const itemData = { name: randomWound.name, type: randomWound.type, - data: randomWound.data, + system: randomWound.system, img: randomWound.img, }; ChatMessage.create({ diff --git a/module/actor/actor.js b/module/actor/actor.js index 74bda1c..9945e63 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -2,15 +2,23 @@ * Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system. * @extends {Actor} */ -export class KnaveActor extends Actor { +export class VaarnActor extends Actor { /** * Augment the basic actor data with additional dynamic data. */ prepareData() { super.prepareData(); + } + + prepareBaseDate() { + + } + + prepareDerivedData() { + const data = this.system; - const flags = this.flags; + const flags = this.flags.vaarn || {}; // Make separate methods for each Actor type (character, npc, etc.) to keep // things organized. diff --git a/module/actor/foe-sheet.js b/module/actor/foe-sheet.js index 4386d97..5d77423 100644 --- a/module/actor/foe-sheet.js +++ b/module/actor/foe-sheet.js @@ -2,13 +2,13 @@ * Extend the basic ActorSheet with some very simple modifications * @extends {ActorSheet} */ -export class KnaveFoeSheet extends ActorSheet { +export class VaarnFoeSheet extends ActorSheet { #_hitTargets = new Set(); /** @override */ static get defaultOptions() { return mergeObject(super.defaultOptions, { - classes: ["knave", "sheet", "actor"], + classes: ["vaarn", "sheet", "actor"], template: "systems/vaultsofvaarn/templates/actor/foe-sheet.html", width: 1000, height: 620, @@ -27,8 +27,8 @@ export class KnaveFoeSheet extends ActorSheet { /** @override */ getData() { - let sheet = super.getData(); - return sheet; + const context = super.getData(); + return context; } /** @override */ @@ -39,27 +39,27 @@ export class KnaveFoeSheet extends ActorSheet { if (!this.options.editable) return; // Add Inventory Item - html.find(".item-create").click(this._onItemCreate.bind(this)); + html.on('click', ".item-create", this._onItemCreate.bind(this)); //ability button clicked - html.find(".knave-ability-button").click((ev) => { + html.on('click', ".vaarn-ability-button", (ev) => { this._onAbility_Clicked($(ev.currentTarget)[0].id); }); - html.find(".knave-morale-button").click(this._onMoraleCheck.bind(this)); - html.find(".knave-armor-button").click(this._onArmorCheck.bind(this)); - html.find(".knave-short-rest-button").click(this._shortRest.bind(this)); - html.find(".knave-long-rest-button").click(this._longRest.bind(this)); - html.find(".knave-wounded-button").click(this._wounded.bind(this)); + html.on('click', ".vaarn-morale-button", this._onMoraleCheck.bind(this)); + html.on('click', ".vaarn-armor-button", this._onArmorCheck.bind(this)); + html.on('click', ".vaarn-short-rest-button", this._shortRest.bind(this)); + html.on('click', ".vaarn-long-rest-button", this._longRest.bind(this)); + html.on('click', ".vaarn-wounded-button", this._wounded.bind(this)); // Update Inventory Item - html.find(".item-edit").click((ev) => { + html.on('click', ".item-edit", (ev) => { const li = $(ev.currentTarget).parents(".item"); const item = this.actor.items.get(li.data("itemId")); item.sheet.render(true); }); // Delete Inventory Item - html.find(".item-delete").click((ev) => { + html.on('click', ".item-delete", (ev) => { const button = ev.currentTarget; const li = button.closest(".item"); const item = this.actor.items.get(li?.dataset.itemId); @@ -67,7 +67,7 @@ export class KnaveFoeSheet extends ActorSheet { }); //inventory weapon rolls - html.find(".item-roll").click((ev) => { + html.on('click', ".item-roll", (ev) => { const li = $(ev.currentTarget).parents(".item"); const item = this.actor.items.get(li.data("itemId")); this._onItemRoll(item, ev.currentTarget); @@ -103,7 +103,7 @@ export class KnaveFoeSheet extends ActorSheet { return cls.create(itemData, { parent: this.actor }); } - _onAbility_Clicked(ability, additional = null) { + async _onAbility_Clicked(ability, additional = null) { let score = 0; let name = ""; switch (ability) { @@ -143,16 +143,16 @@ export class KnaveFoeSheet extends ActorSheet { let formula = `2d10+${score}`; let r = new Roll(formula); - r.evaluate({ async: false }); + await r.evaluate(); let returnCode = 0; let messageHeader = "" + name + ""; if (r.dice[0].total <= 3) messageHeader += - ' - CRITICAL FAILURE!'; + ' - CRITICAL FAILURE!'; else if (r.dice[0].total >= 19) messageHeader += - ' - CRITICAL SUCCESS!'; + ' - CRITICAL SUCCESS!'; r.toMessage({ speaker: ChatMessage.getSpeaker({ actor: this.actor }), @@ -161,38 +161,38 @@ export class KnaveFoeSheet extends ActorSheet { return r; } - _onMoraleCheck(event) { + async _onMoraleCheck(event) { event.preventDefault(); let r = new Roll(`1d20+${this.object.system.morale.value}`); - r.evaluate({ async: false }); + await r.evaluate(); let messageHeader = ""; if (r._total < 15) messageHeader += - 'Is fleeing'; + 'Is fleeing'; else messageHeader += - 'Is staying'; + 'Is staying'; r.toMessage({ flavor: messageHeader }); } - _onArmorCheck(event) { + async _onArmorCheck(event) { let name = "ARMOR"; let score = this.object.system.armor.bonus; event.preventDefault(); let formula = `1d20+${score}`; let r = new Roll(formula); - r.evaluate({ async: false }); + await r.evaluate(); let returnCode = 0; let messageHeader = "" + name + ""; if (r.dice[0].total === 1) messageHeader += - ' - CRITICAL FAILURE!'; + ' - CRITICAL FAILURE!'; else if (r.dice[0].total === 20) messageHeader += - ' - CRITICAL SUCCESS!'; + ' - CRITICAL SUCCESS!'; r.toMessage({ speaker: ChatMessage.getSpeaker({ actor: this.actor }), @@ -201,7 +201,7 @@ export class KnaveFoeSheet extends ActorSheet { return r; } - _onItemRoll(item, eventTarget) { + async _onItemRoll(item, eventTarget) { if (eventTarget.title === "attack") { if (item.type === "weaponMelee") { const roll = this._onAbility_Clicked( @@ -215,7 +215,7 @@ export class KnaveFoeSheet extends ActorSheet { } } else if (eventTarget.title === "damage") { let r = new Roll(item.system.damageDice); - r.evaluate({ async: false }); + await r.evaluate(); let messageHeader = "" + item.name + " damage"; r.toMessage({ speaker: ChatMessage.getSpeaker({ actor: this.actor }), @@ -292,11 +292,11 @@ export class KnaveFoeSheet extends ActorSheet { token.actor.update({ "system.health.value": newHP }); } - _shortRest(event) { + async _shortRest(event) { const conBonus = this.object.system.abilities.con.value; let formula = `1d8+${conBonus}`; let r = new Roll(formula); - r.evaluate({ async: false }); + await r.evaluate(); this.object.update({ "system.health.value": r.total + this.object.system.health.value, }); diff --git a/module/item/item-sheet.js b/module/item/item-sheet.js index b4ecf15..5ae802f 100644 --- a/module/item/item-sheet.js +++ b/module/item/item-sheet.js @@ -2,11 +2,11 @@ * Extend the basic ItemSheet with some very simple modifications * @extends {ItemSheet} */ -export class KnaveItemSheet extends ItemSheet { +export class VaarnItemSheet extends ItemSheet { /** @override */ static get defaultOptions() { - return mergeObject(super.defaultOptions, { - classes: ["knave", "sheet", "item"], + return foundry.utils.mergeObject(super.defaultOptions, { + classes: ["vaarn", "sheet", "item"], width: 520, height: 480, tabs: [ diff --git a/module/item/item.js b/module/item/item.js index fe70ce0..c7a9918 100644 --- a/module/item/item.js +++ b/module/item/item.js @@ -2,24 +2,28 @@ * Extend the basic Item with some very simple modifications. * @extends {Item} */ -export class KnaveItem extends Item { +export class VaarnItem extends Item { /** * Augment the basic Item data model with additional dynamic data. */ prepareData() { super.prepareData(); + } + + prepareDerivedData() { + super.prepareDerivedData(); // Get the Item's data //const itemData = this.data; const actorData = this.actor ? this.actor : {}; - const data = this.system; + const itemData = this.system; if(this.type === "weaponRanged") { - if(data.ammo.value > data.ammo.max) - data.ammo.value = data.ammo.max; - else if(data.ammo.value < data.ammo.min) - data.ammo.value = data.ammo.min; + if(itemData.ammo.value > itemData.ammo.max) + itemData.ammo.value = itemData.ammo.max; + else if(itemData.ammo.value < itemData.ammo.min) + itemData.ammo.value = itemData.ammo.min; } } } diff --git a/module/settings.js b/module/settings.js index 3eeef5e..957615e 100644 --- a/module/settings.js +++ b/module/settings.js @@ -9,7 +9,7 @@ export const registerSystemSettings = () => { scope: "world", config: true, type: Boolean, - default: false, + default: false }); }; diff --git a/module/vaarn.js b/module/vaarn.js new file mode 100644 index 0000000..d2e5653 --- /dev/null +++ b/module/vaarn.js @@ -0,0 +1,88 @@ +// Import Modules +import { VaarnActor } from "./actor/actor.js"; +import { VaarnActorSheet } from "./actor/actor-sheet.js"; +import { VaarnFoeSheet } from "./actor/foe-sheet.js"; +import { VaarnItem } from "./item/item.js"; +import { VaarnItemSheet } from "./item/item-sheet.js"; +import { Vaarn } from "./config.js"; +import { registerSystemSettings } from "./settings.js"; + +Hooks.once("init", async function () { + game.Vaarn = { + VaarnActor, + VaarnItem + }; + + CONFIG.Vaarn = Vaarn; + + /** + * Set an initiative formula for the system + * @type {String} + */ + CONFIG.Combat.initiative = { + formula: "1d20", + decimals: 2 + }; + // Define custom Entity classes + CONFIG.Actor.documentClass = VaarnActor; + CONFIG.Item.documentClass = VaarnItem; + + registerSystemSettings(); + + // Register sheet application classes + Actors.unregisterSheet("core", ActorSheet); + Actors.registerSheet("vaarn", VaarnActorSheet, { makeDefault: true }); + Actors.registerSheet("vaarn", VaarnFoeSheet, { makeDefault: false }); + Items.unregisterSheet("core", ItemSheet); + Items.registerSheet("vaarn", VaarnItemSheet, { makeDefault: true }); +}); + +// Handlebar helpers +Handlebars.registerHelper("concat", function () { + var outStr = ""; + for (var arg in arguments) { + if (typeof arguments[arg] != "object") { + outStr += arguments[arg]; + } + } + return outStr; +}); + +Handlebars.registerHelper("toLowerCase", function (str) { + return str.toLowerCase(); +}); + +Handlebars.registerHelper("isWeapon", function (item) { + return item.type === "weaponMelee" || item.type === "weaponRanged"; +}); + +Handlebars.registerHelper("inventorySlots", function (inventorySlots) { + if (inventorySlots && inventorySlots.used >= inventorySlots.value) + return new Handlebars.SafeString( + '' + + inventorySlots.used + + "/" + + inventorySlots.value + + "" + ); + else if (inventorySlots) + return new Handlebars.SafeString( + inventorySlots.used + "/" + inventorySlots.value + ); +}); + +Handlebars.registerHelper("isItemBroken", function (item) { + if (item.type === "spell") + return item.system.used === "true" || !item.system.spellUsable; + else { + if (item.system.quality) return item.system.quality.value <= 0; + else return false; + } +}); + +Handlebars.registerHelper("hasQuality", function (item) { + return item.system.quality !== undefined; +}); +Handlebars.registerHelper("hasQuantity", function (item) { + return item.system.quantity > 1; +}); \ No newline at end of file diff --git a/css/knave.css b/styles/vaarn.css similarity index 87% rename from css/knave.css rename to styles/vaarn.css index 8b7f550..0109bd6 100644 --- a/css/knave.css +++ b/styles/vaarn.css @@ -142,12 +142,12 @@ justify-content: space-between; } -/* Styles limited to knave sheets */ -.knave .item-form { +/* Styles limited to vaarn sheets */ +.vaarn .item-form { font-family: "Courier New", sans-serif; } -.knave .sheet-header { +.vaarn .sheet-header { -webkit-box-flex: 0; -ms-flex: 0 0 120px; flex: 0 0 120px; @@ -167,7 +167,7 @@ margin-bottom: 10px; } -.knave .sheet-header .profile-img { +.vaarn .sheet-header .profile-img { -webkit-box-flex: 0; -ms-flex: 0 0 100px; flex: 0 0 100px; @@ -175,34 +175,34 @@ margin-right: 10px; } -.knave .sheet-header .header-fields { +.vaarn .sheet-header .header-fields { -webkit-box-flex: 1; -ms-flex: 1; flex: 1; } -.knave .sheet-header h1.charname { +.vaarn .sheet-header h1.charname { height: 50px; padding: 0px; margin: 5px 0; border-bottom: 0; } -.knave .sheet-header h1.charname input { +.vaarn .sheet-header h1.charname input { width: 100%; height: 100%; margin: 0; } -.knave .sheet-tabs { +.vaarn .sheet-tabs { -webkit-box-flex: 0; -ms-flex: 0; flex: 0; } -.knave .sheet-body, -.knave .sheet-body .tab, -.knave .sheet-body .tab .editor { +.vaarn .sheet-body, +.vaarn .sheet-body .tab, +.vaarn .sheet-body .tab .editor { height: 100%; background: #fff; } @@ -217,69 +217,69 @@ resize: vertical; } -.knave .tox .tox-editor-container { +.vaarn .tox .tox-editor-container { background: #fff; } -.knave .tox .tox-edit-area { +.vaarn .tox .tox-edit-area { padding: 0 8px; } -.knave .resource-label { +.vaarn .resource-label { font-weight: bold; text-transform: uppercase; } -.knave .tabs { +.vaarn .tabs { height: 40px; border-top: 1px solid #aaa; border-bottom: 1px solid #aaa; } -.knave .tabs .item { +.vaarn .tabs .item { line-height: 40px; font-weight: bold; } -.knave .tabs .item.active { +.vaarn .tabs .item.active { text-decoration: underline; text-shadow: none; } -.knave .items-list { +.vaarn .items-list { list-style: none; margin: 7px 0; padding: 0; overflow-y: auto; } -.knave .items-list .item-header { +.vaarn .items-list .item-header { font-weight: bold; } -.knave .items-list .item { +.vaarn .items-list .item { align-items: center; line-height: 24px; padding: 3px 0; border-bottom: 1px solid #bbb; } -.knave .items-list .item .item-image { +.vaarn .items-list .item .item-image { -webkit-box-flex: 0; -ms-flex: 0 0 24px; flex: 0 0 24px; margin-right: 5px; } -.knave .items-list .item img { +.vaarn .items-list .item img { display: block; } -.knave .items-list .item-name { +.vaarn .items-list .item-name { margin: 0; } -.knave .items-list .item-controls { +.vaarn .items-list .item-controls { -webkit-box-flex: 0; -ms-flex: 0 0 86px; flex: 0 0 86px; @@ -288,39 +288,39 @@ white-space: nowrap; } -.knave .item-roll img:hover { +.vaarn .item-roll img:hover { opacity: 0.5; } -.knave .item-roll { +.vaarn .item-roll { cursor: pointer; color: #fff; } -.knave .item-roll button { +.vaarn .item-roll button { cursor: pointer; color: #fff; border: 1px solid #fff; } -.knave-ability-button { +.vaarn-ability-button { width: 60px; height: 28px; } -.knave-armor-button { +.vaarn-armor-button { width: 60px; height: 28px; } -.knave-morale-button { +.vaarn-morale-button { } -.knave-ability-crit { +.vaarn-ability-crit { font-size: 1.2em; font-weight: bold; text-transform: uppercase; } -.knave-ability-critSuccess { +.vaarn-ability-critSuccess { color: green; } -.knave-ability-critFailure { +.vaarn-ability-critFailure { color: red; } @@ -328,24 +328,24 @@ content: "This text is editable"; } -.knave-character-description { +.vaarn-character-description { min-height: 200px; height: 100%; resize: both; } -.knave-encumbered { +.vaarn-encumbered { color: red; } -.knave .resource-label-small { +.vaarn .resource-label-small { font-weight: bold; text-transform: uppercase; font-size: 0.8em; vertical-align: middle; } -.knave .align-left { +.vaarn .align-left { text-align: left; } @@ -431,9 +431,9 @@ outline: 2px solid var(--highlight-background-color); box-shadow: 0 0 10px var(--highlight-background-color); } -.knave .sheet-body, -.knave .sheet-body .tab, -.knave .sheet-body .tab .editor, +.vaarn .sheet-body, +.vaarn .sheet-body .tab, +.vaarn .sheet-body .tab .editor, .dialog .dialog-buttons button { background: var(--highlight-background-color); color: var(--text-color); diff --git a/system.json b/system.json index 7ec628e..5aeb79f 100644 --- a/system.json +++ b/system.json @@ -2,13 +2,24 @@ "id": "vaultsofvaarn", "title": "Vaults of Vaarn", "description": "Vaults of Vaarn is a rules toolkit and setting created by Leo Hunt for exploring a post apocalyptic, near earth wasteland.", - "version": "0.0.16", + "version": "0.0.18", "compatibility": { - "minimum": "10", - "verified": "10.291" + "minimum": "12", + "verified": "12.331" }, - "esmodules": ["module/knave.js"], - "styles": ["css/knave.css"], + "authors": [ + { + "name": "omniczech" + }, + { + "name": "crinelam", + "url": "crinelam.neocities.org", + "email": "crinelam@tutamail.com", + "discord": "crinelam" + } + ], + "esmodules": ["module/vaarn.js"], + "styles": ["styles/vaarn.css"], "packs": [ { "name": "armor", @@ -16,8 +27,7 @@ "system": "vaultsofvaarn", "path": "packs/armor.db", "type": "Item", - "private": false, - "flags": {} + "private": false }, { "name": "clothing", @@ -25,8 +35,7 @@ "system": "vaultsofvaarn", "path": "packs/clothing.db", "type": "Item", - "private": false, - "flags": {} + "private": false }, { "name": "exotica", @@ -34,8 +43,7 @@ "system": "vaultsofvaarn", "path": "packs/exotica.db", "type": "Item", - "private": false, - "flags": {} + "private": false }, { "name": "food", @@ -43,8 +51,7 @@ "system": "vaultsofvaarn", "path": "packs/food.db", "type": "Item", - "private": false, - "flags": {} + "private": false }, { "name": "items", @@ -52,8 +59,7 @@ "system": "vaultsofvaarn", "path": "packs/items.db", "type": "Item", - "private": false, - "flags": {} + "private": false }, { "name": "mysticGifts", @@ -61,8 +67,7 @@ "system": "vaultsofvaarn", "path": "packs/mysticGifts.db", "type": "Item", - "private": false, - "flags": {} + "private": false }, { "name": "weapons", @@ -70,8 +75,7 @@ "system": "vaultsofvaarn", "path": "packs/weapons.db", "type": "Item", - "private": false, - "flags": {} + "private": false }, { "name": "wounds", @@ -79,8 +83,7 @@ "system": "vaultsofvaarn", "path": "packs/wounds.db", "type": "Item", - "private": false, - "flags": {} + "private": false }, { "name": "foes", @@ -88,8 +91,7 @@ "system": "vaultsofvaarn", "path": "packs/foes.db", "type": "Actor", - "private": false, - "flags": {} + "private": false } ], "languages": [ @@ -99,17 +101,14 @@ "path": "lang/en.json" } ], - "gridDistance": 5, - "gridUnits": "ft", - "primaryTokenAttribute": "health", + "initiative": "1d20", + "grid": { + "distance": 5, + "units": "ft" + }, + "primaryTokenAttribute": "resources.health", "url": "https://github.com/omniczech/vaultsofvaarn", - "manifest": "https://raw.githubusercontent.com/omniczech/vaarn-foundryvtt/main/system.json", - "download": "https://github.com/omniczech/vaarn-foundryvtt/archive/refs/tags/0.0.16.zip", - "license": "LICENSE.txt", - "authors": [ - { - "name": "omniczech", - "flags": {} - } - ] + "manifest": "https://raw.githubusercontent.com/crinelam/vaarn-foundryvtt-v12/refs/heads/v12/system.json", + "download": "https://github.com/crinelam/vaarn-foundryvtt-v12/archive/refs/tags/0.0.18.zip", + "license": "LICENSE.txt" } diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index 3958906..f3d8789 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.html @@ -39,9 +39,9 @@

HP: / - - - + + +
@@ -50,7 +50,7 @@

DEFENSEABILITYBONUSDEFENSEABILITYBONUS {{#each data.system.abilities as |ability key|}} {{numberFormat ability.defense decimals=0 sign=false}} - + {{/each}}

@@ -68,8 +68,8 @@

{{!-- Description Tab --}}
-
- {{editor content=data.system.biography target="system.biography" button=true owner=owner editable=editable}} +
+ {{editor data.system.biography target="system.biography" button=true owner=owner editable=editable}}
{{!-- Combat Tab --}} @@ -85,7 +85,7 @@

-

{{item.name}}

+

{{item.name}}

{{/if}} @@ -105,7 +105,7 @@

{{item. {{#each actor.items as |item id|}}
  • -

    {{item.name}} {{#if (hasQuantity item)}}({{item.system.quantity}}){{/if}}  

    +

    {{item.name}} {{#if (hasQuantity item)}}({{item.system.quantity}}){{/if}}  

    diff --git a/templates/actor/foe-sheet.html b/templates/actor/foe-sheet.html index f75bcd3..8b7392e 100644 --- a/templates/actor/foe-sheet.html +++ b/templates/actor/foe-sheet.html @@ -25,7 +25,7 @@

    MORALE - +

    @@ -53,11 +53,11 @@

    {{/if}} -

    {{item.name}}

    +

    {{item.name}}

    @@ -73,8 +73,8 @@

    {{item. {{!-- Description Tab --}}
    -
    - {{editor content=data.system.description target="system.description" button=true owner=owner editable=editable}} +
    + {{editor data.system.description target="system.description" button=true owner=owner editable=editable}}
    diff --git a/templates/item/armor-sheet.html b/templates/item/armor-sheet.html index bcc4320..5f1c99c 100644 --- a/templates/item/armor-sheet.html +++ b/templates/item/armor-sheet.html @@ -47,7 +47,7 @@

    {{!-- Description Tab --}}
    - {{editor content=data.system.description target="data.description" + {{editor data.system.description target="data.description" button=true owner=owner editable=editable}}
    diff --git a/templates/item/exotica-sheet.html b/templates/item/exotica-sheet.html index dae4866..7ee14ad 100644 --- a/templates/item/exotica-sheet.html +++ b/templates/item/exotica-sheet.html @@ -38,7 +38,7 @@

    {{!-- Description Tab --}}
    - {{editor content=data.system.description target="data.description" + {{editor data.system.description target="data.description" button=true owner=owner editable=editable}}
    diff --git a/templates/item/item-sheet.html b/templates/item/item-sheet.html index 4f0ecd4..c2b4ba7 100644 --- a/templates/item/item-sheet.html +++ b/templates/item/item-sheet.html @@ -47,7 +47,7 @@

    {{!-- Description Tab --}}
    - {{editor content=data.system.description target="data.description" + {{editor data.system.description target="data.description" button=true owner=owner editable=editable}}
    diff --git a/templates/item/light-sheet.html b/templates/item/light-sheet.html index 8eb4343..69857e9 100644 --- a/templates/item/light-sheet.html +++ b/templates/item/light-sheet.html @@ -33,7 +33,7 @@

    {{!-- Description Tab --}}
    - {{editor content=data.system.description target="data.description" button=true owner=owner editable=editable}} + {{editor data.system.description target="data.description" button=true owner=owner editable=editable}}
    diff --git a/templates/item/mysticGifts-sheet.html b/templates/item/mysticGifts-sheet.html index dae4866..7ee14ad 100644 --- a/templates/item/mysticGifts-sheet.html +++ b/templates/item/mysticGifts-sheet.html @@ -38,7 +38,7 @@

    {{!-- Description Tab --}}
    - {{editor content=data.system.description target="data.description" + {{editor data.system.description target="data.description" button=true owner=owner editable=editable}}
    diff --git a/templates/item/spell-sheet.html b/templates/item/spell-sheet.html index 993e395..2adb70c 100644 --- a/templates/item/spell-sheet.html +++ b/templates/item/spell-sheet.html @@ -38,7 +38,7 @@

    {{!-- Description Tab --}}
    - {{editor content=data.system.description target="data.description" button=true owner=owner editable=editable}} + {{editor data.system.description target="data.description" button=true owner=owner editable=editable}}
    diff --git a/templates/item/weaponMelee-sheet.html b/templates/item/weaponMelee-sheet.html index ccbc31d..4c5bdf4 100644 --- a/templates/item/weaponMelee-sheet.html +++ b/templates/item/weaponMelee-sheet.html @@ -27,7 +27,7 @@

    {{!-- Description Tab --}}
    - {{editor content=data.system.description target="data.description" button=true owner=owner editable=editable}} + {{editor data.system.description target="data.description" button=true owner=owner editable=editable}}
    diff --git a/templates/item/weaponRanged-sheet.html b/templates/item/weaponRanged-sheet.html index 1e47b16..d049781 100644 --- a/templates/item/weaponRanged-sheet.html +++ b/templates/item/weaponRanged-sheet.html @@ -73,7 +73,7 @@

    {{!-- Description Tab --}}
    - {{editor content=data.system.description target="data.description" + {{editor data.system.description target="data.description" button=true owner=owner editable=editable}}
    diff --git a/templates/item/wound-sheet.html b/templates/item/wound-sheet.html index dae4866..7ee14ad 100644 --- a/templates/item/wound-sheet.html +++ b/templates/item/wound-sheet.html @@ -38,7 +38,7 @@

    {{!-- Description Tab --}}
    - {{editor content=data.system.description target="data.description" + {{editor data.system.description target="data.description" button=true owner=owner editable=editable}}