diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a6be005..780ef0c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -66,3 +66,4 @@ v1.6.2 Fix tooltip bugs v1.6.3 Fix Vice rolls +v1.6.4 Fix createItem hook issues in 0.8.x, switch XP triggers to tooltip on hover diff --git a/module/sav-helpers.js b/module/sav-helpers.js index b8b352b..a89c17b 100644 --- a/module/sav-helpers.js +++ b/module/sav-helpers.js @@ -1,27 +1,28 @@ export class SaVHelpers { /** - * Removes a duplicate item type from charlist. + * Identifies duplicate items by type and returns a array of item ids to remove * * @param {Object} item_data * @param {Document} actor + * @returns {Array} + * */ static removeDuplicatedItemType(item_data, actor) { - + let dupe_list = []; let distinct_types = ["crew_reputation", "class", "background", "vice", "heritage", "ship_size", "crew_type"]; + let allowed_types = ["item"]; let should_be_distinct = distinct_types.includes(item_data.type); // If the Item has the exact same name - remove it from list. // Remove Duplicate items from the array. - actor.items.forEach(i => { + actor.items.forEach( i => { let has_double = (item_data.type === i.data.type); - if (i.data.name === item_data.name || (should_be_distinct && has_double)) { - if( game.majorVersion > 7 ) { - actor.deleteEmbeddedDocuments("Item", [i.id]); - } else { - actor.deleteOwnedItem(i.id); - } + if ( ( ( i.name === item_data.name ) || ( should_be_distinct && has_double ) ) && !( allowed_types.includes( item_data.type ) ) && ( item_data._id !== i.id ) ) { + dupe_list.push (i.id); } }); + + return dupe_list; } /** diff --git a/module/sav-item.js b/module/sav-item.js index 32b1d5f..935b368 100644 --- a/module/sav-item.js +++ b/module/sav-item.js @@ -1,9 +1,70 @@ +import { SaVHelpers } from "./sav-helpers.js"; + /** * Extend the basic Item * @extends {Item} */ export class SaVItem extends Item { + /** @override */ + async _preCreate( data, options, user ) { + await super._preCreate( data, options, user ); + + let removeItems = []; + if( user.id === game.user.id ) { + let actor = this.parent ? this.parent : null; + if( ( game.majorVersion > 7 ) && ( actor?.documentName === "Actor" ) ) { + removeItems = SaVHelpers.removeDuplicatedItemType( data, actor ); + } + if( removeItems ) { + await actor.deleteEmbeddedDocuments( "Item", removeItems ); + } + } + } + + /* -------------------------------------------- */ + + /** @override */ + async _onCreate( data, options, userId ) { + super._onCreate( data, options, userId ); + + if( userId === game.user.id ) { + let actor = this.parent ? this.parent : null; + + if( ( game.majorVersion > 7 ) && ( actor?.documentName === "Actor" ) && ( actor?.permission >= CONST.ENTITY_PERMISSIONS.OWNER ) ) { + await SaVHelpers.callItemLogic( data, actor ); + + if( ( game.majorVersion > 7 ) && ( ( data.type === "class" ) || ( data.type === "crew_type" ) ) && ( data.data.def_abilities !== "" ) ) { + await SaVHelpers.addDefaultAbilities( data, actor ); + } + + if( ( game.majorVersion > 7 ) && ( ( data.type === "class" ) || ( data.type === "crew_type" ) ) && ( ( actor.img.slice( 0, 46 ) === "systems/scum-and-villainy/styles/assets/icons/" ) || ( actor.img === "icons/svg/mystery-man.svg" ) ) ) { + const icon = data.img; + const icon_update = { + img: icon, + token: { + img: icon + } + }; + await actor.update( icon_update ); + } + } + } + } + + /* -------------------------------------------- */ + + /** @override */ + async _onDelete( options, userId ) { + super._onDelete( options, userId ); + + let actor = this.parent ? this.parent : null; + let data = this.data; + if( ( game.majorVersion > 7 ) && ( actor?.documentName === "Actor" ) && ( actor?.permission >= CONST.ENTITY_PERMISSIONS.OWNER ) ) { + await SaVHelpers.undoItemLogic( data, actor ); + } + } + /* override */ prepareData() { super.prepareData(); diff --git a/module/sav-sheet.js b/module/sav-sheet.js index 2b11756..4b3bd13 100644 --- a/module/sav-sheet.js +++ b/module/sav-sheet.js @@ -188,7 +188,7 @@ async _onFlagAddClick(event) { if ( perms >= CONST.ENTITY_PERMISSIONS.OWNER ) { let dialog = new Dialog({ - title: `${game.i18n.localize('BITD.Add')} ${item_type}`, + title: `${game.i18n.localize('BITD.Add')} ${game.i18n.localize('BITD.' + SaVHelpers.getProperCase(item_type) )}`, content: html, buttons: { one: { diff --git a/module/sav.js b/module/sav.js index b5f2076..336b16b 100644 --- a/module/sav.js +++ b/module/sav.js @@ -284,44 +284,9 @@ Hooks.once("ready", async function() { * Hooks */ - -Hooks.on("preCreateItem", async (item, data, options, userId) => { - - let actor = item.parent ? item.parent : null; - if ( ( game.majorVersion > 7 ) && ( actor?.documentName === "Actor" ) ) { - await SaVHelpers.removeDuplicatedItemType(data, actor); - - if ( ( ( data.type === "class" ) || ( data.type === "crew_type" ) ) && !( data.data.def_abilities === "" ) ) { - await SaVHelpers.addDefaultAbilities( data, actor ); - } - - if ( ( ( data.type === "class" ) || ( data.type === "crew_type" ) ) && ( ( actor.img.slice( 0, 46 ) === "systems/scum-and-villainy/styles/assets/icons/" ) || ( actor.img === "icons/svg/mystery-man.svg" ) ) ) { - const icon = data.img; - const icon_update = { - img: icon, - token: { - img: icon - } - }; - await actor.update( icon_update ); - /** code to replace all attached tokens as well - const tokens = actor.getActiveTokens(); - let token_update; - if ( tokens ) { - token_update = { - img: icon - }; - tokens.forEach( t => t.update( token_update ) ); - }; - */ - } - } - return true; -}); - Hooks.on("preCreateOwnedItem", async (parent_entity, child_data, options, userId) => { if( game.majorVersion === 7 ) { - await SaVHelpers.removeDuplicatedItemType(child_data, parent_entity); + await parent_entity.deleteOwnedItem( await SaVHelpers.removeDuplicatedItemType(child_data, parent_entity) ); if ( ( ( child_data.type === "class" ) || ( child_data.type === "crew_type" ) ) && !( child_data.data.def_abilities === "" ) ) { await SaVHelpers.addDefaultAbilities( child_data, parent_entity ); @@ -341,16 +306,6 @@ Hooks.on("preCreateOwnedItem", async (parent_entity, child_data, options, userId return true; }); -Hooks.on("createItem", async (item, options, userId) => { - - let actor = item.parent ? item.parent : null; - let data = item.data; - if ( ( game.majorVersion > 7 ) && (actor?.documentName === "Actor") && (actor?.permission >= CONST.ENTITY_PERMISSIONS.OWNER) ) { - await SaVHelpers.callItemLogic(data, actor); - } - return true; -}); - Hooks.on("createOwnedItem", async (parent_entity, child_data, options, userId) => { if ( ( game.majorVersion === 7 ) && (parent_entity.entity === "Actor") && (parent_entity.permission >= CONST.ENTITY_PERMISSIONS.OWNER) ) { await SaVHelpers.callItemLogic(child_data, parent_entity); @@ -358,15 +313,6 @@ Hooks.on("createOwnedItem", async (parent_entity, child_data, options, userId) = return true; }); -Hooks.on("deleteItem", async (item, options, userId) => { - let actor = item.parent ? item.parent : null; - let data = item.data; - if ( ( game.majorVersion > 7 ) && (actor?.documentName === "Actor") && (actor?.permission >= CONST.ENTITY_PERMISSIONS.OWNER) ) { - await SaVHelpers.undoItemLogic(data, actor); - } - return true; -}); - Hooks.on("deleteOwnedItem", async (parent_entity, child_data, options, userId) => { if ( ( game.majorVersion === 7 ) && (parent_entity.entity === "Actor") && (parent_entity.permission >= CONST.ENTITY_PERMISSIONS.OWNER) ) { await SaVHelpers.undoItemLogic(child_data, parent_entity); diff --git a/packs/classes.db b/packs/classes.db index ffb08ce..ef011c2 100644 --- a/packs/classes.db +++ b/packs/classes.db @@ -1,7 +1,7 @@ -{"_id":"1Ly6nRUcjZsH7n6E","name":"Stitch","permission":{"default":0},"type":"class","data":{"description":"Spacefaring healer or scientist","logic":"[{\"attribute\":\"data.attributes.insight.skills.doctor.value\",\"operator\":\"attribute_change\",\"value\":2,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.hack.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.rig.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.study.value\",\"operator\":\"attribute_change\",\"value\":1,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.helm.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scramble.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scrap.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.skulk.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.attune.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.command.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.consort.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.sway.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.character_class\",\"operator\":\"attribute_change\",\"value\":\"Stitch\",\"requirement\":\"\"}]","def_abilities":"(St) I'm a Doctor Not a..., Jackev, Alben, Ditha, Juda, Lynie","experience_clues":"- You addressed a tough challenge with insight or compassion."},"flags":{},"img":"systems/scum-and-villainy/styles/assets/icons/Icon.7_84.png","effects":[]} -{"_id":"CjzxaYvNhEqUXTGT","name":"Muscle","permission":{"default":0},"type":"class","data":{"description":"A dangerous and intimidating fighter","logic":"[{\"attribute\":\"data.attributes.insight.skills.doctor.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.hack.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.rig.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.study.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.helm.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scramble.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scrap.value\",\"operator\":\"attribute_change\",\"value\":2,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.skulk.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.attune.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.command.value\",\"operator\":\"attribute_change\",\"value\":1,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.consort.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.sway.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.character_class\",\"operator\":\"attribute_change\",\"value\":\"Muscle\",\"requirement\":\"\"}]","def_abilities":"(Mu) Unstoppable, Krieger, Shod, Chon-zek, Yazu, Aya","experience_clues":"- You addressed a tough challenge with force or threats.","abilities":""},"flags":{},"img":"systems/scum-and-villainy/styles/assets/icons/Icon.4_64.png","effects":[]} -{"_id":"O4Af7Md1ueJOCudl","name":"Speaker","permission":{"default":0},"type":"class","data":{"description":"A respectable person on the take","logic":"[{\"attribute\":\"data.attributes.insight.skills.doctor.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.hack.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.rig.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.study.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.helm.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scramble.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scrap.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.skulk.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.attune.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.command.value\",\"operator\":\"attribute_change\",\"value\":1,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.consort.value\",\"operator\":\"attribute_change\",\"value\":2,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.sway.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.character_class\",\"operator\":\"attribute_change\",\"value\":\"Speaker\",\"requirement\":\"\"}]","def_abilities":"(Sp) Air of Respectability, Arryn, Manda, Kerry, Je-zee, ?","experience_clues":"- You addressed a tough challenge with deception or influence."},"flags":{},"img":"systems/scum-and-villainy/styles/assets/icons/Icon.5_53.png","effects":[]} -{"_id":"ZEbq3hXyriAWUVOl","name":"Mystic","permission":{"default":0},"type":"class","data":{"description":"A galactic wanderer in touch with the Way","logic":"[{\"attribute\":\"data.attributes.insight.skills.doctor.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.hack.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.rig.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.study.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.helm.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scramble.value\",\"operator\":\"attribute_change\",\"value\":1,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scrap.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.skulk.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.attune.value\",\"operator\":\"attribute_change\",\"value\":2,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.command.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.consort.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.sway.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.character_class\",\"operator\":\"attribute_change\",\"value\":\"Mystic\",\"requirement\":\"\"}]","def_abilities":"(My) The Way, Horux, Hicks, Laxx, Rye, Blish","experience_clues":"- You addressed a tough challenge with wisdom or the Way."},"flags":{},"img":"systems/scum-and-villainy/styles/assets/icons/Icon.2_94.png","effects":[]} -{"_id":"jYEumqd1vBm5pwQv","name":"Mechanic","permission":{"default":0},"type":"class","data":{"description":"A gearhead and hacker","logic":"[{\"attribute\":\"data.attributes.insight.skills.doctor.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.hack.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.rig.value\",\"operator\":\"attribute_change\",\"value\":2,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.study.value\",\"operator\":\"attribute_change\",\"value\":1,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.helm.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scramble.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scrap.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.skulk.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.attune.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.command.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.consort.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.sway.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.character_class\",\"operator\":\"attribute_change\",\"value\":\"Mechanic\",\"requirement\":\"\"}]","def_abilities":"(Me) Tinker, Slice, Nisa, Stev, Len, Kenn","experience_clues":"- You addressed a tough challenge with technical skill or ingenuity.","abilities":""},"flags":{},"img":"systems/scum-and-villainy/styles/assets/icons/Icon.3_89.png","effects":[]} -{"_id":"ppl97fxZDlMYAogz","name":"Pilot","permission":{"default":0},"type":"class","data":{"description":"A ship-handling wizard and danger addict","logic":"[{\"attribute\":\"data.attributes.insight.skills.doctor.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.hack.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.rig.value\",\"operator\":\"attribute_change\",\"value\":1,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.study.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.helm.value\",\"operator\":\"attribute_change\",\"value\":2,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scramble.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scrap.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.skulk.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.attune.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.command.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.consort.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.sway.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.character_class\",\"operator\":\"attribute_change\",\"value\":\"Pilot\",\"requirement\":\"\"}]","def_abilities":"(P) Ace Pilot, Yattu, Triv, Choss, Meris, Mav","experience_clues":"- You addressed a tough challenge with speed or flair."},"flags":{},"img":"systems/scum-and-villainy/styles/assets/icons/rocket-flight.png","effects":[]} -{"_id":"q83Y3IkZfS1RhSYG","name":"Scoundrel","permission":{"default":0},"type":"class","data":{"description":"A scrappy and lucky survivor","logic":"[{\"attribute\":\"data.attributes.insight.skills.doctor.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.hack.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.rig.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.study.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.helm.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scramble.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scrap.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.skulk.value\",\"operator\":\"attribute_change\",\"value\":1,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.attune.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.command.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.consort.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.sway.value\",\"operator\":\"attribute_change\",\"value\":2,\"requirement\":\"\"},{\"attribute\":\"data.character_class\",\"operator\":\"attribute_change\",\"value\":\"Scoundrel\",\"requirement\":\"\"}]","def_abilities":"(Sc) Serendipitous, Nyx, Ora, Jal, Rhin, Battro","experience_clues":"- You addressed a tough challenge with charm or audacity."},"flags":{},"img":"systems/scum-and-villainy/styles/assets/icons/Icon.4_06.png","effects":[]} +{"_id":"1Ly6nRUcjZsH7n6E","name":"Stitch","permission":{"default":0},"type":"class","data":{"description":"Spacefaring healer or scientist","logic":"[{\"attribute\":\"data.attributes.insight.skills.doctor.value\",\"operator\":\"attribute_change\",\"value\":2,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.hack.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.rig.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.study.value\",\"operator\":\"attribute_change\",\"value\":1,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.helm.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scramble.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scrap.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.skulk.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.attune.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.command.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.consort.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.sway.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.character_class\",\"operator\":\"attribute_change\",\"value\":\"Stitch\",\"requirement\":\"\"}]","def_abilities":"(St) I'm a Doctor Not a..., Jackev, Alben, Ditha, Juda, Lynie","experience_clues":"You addressed a tough challenge with insight or compassion."},"flags":{},"img":"systems/scum-and-villainy/styles/assets/icons/Icon.7_84.png","effects":[]} +{"_id":"CjzxaYvNhEqUXTGT","name":"Muscle","permission":{"default":0},"type":"class","data":{"description":"A dangerous and intimidating fighter","logic":"[{\"attribute\":\"data.attributes.insight.skills.doctor.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.hack.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.rig.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.study.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.helm.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scramble.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scrap.value\",\"operator\":\"attribute_change\",\"value\":2,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.skulk.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.attune.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.command.value\",\"operator\":\"attribute_change\",\"value\":1,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.consort.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.sway.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.character_class\",\"operator\":\"attribute_change\",\"value\":\"Muscle\",\"requirement\":\"\"}]","def_abilities":"(Mu) Unstoppable, Krieger, Shod, Chon-zek, Yazu, Aya","experience_clues":"You addressed a tough challenge with force or threats.","abilities":""},"flags":{},"img":"systems/scum-and-villainy/styles/assets/icons/Icon.4_64.png","effects":[]} +{"_id":"O4Af7Md1ueJOCudl","name":"Speaker","permission":{"default":0},"type":"class","data":{"description":"A respectable person on the take","logic":"[{\"attribute\":\"data.attributes.insight.skills.doctor.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.hack.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.rig.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.study.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.helm.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scramble.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scrap.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.skulk.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.attune.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.command.value\",\"operator\":\"attribute_change\",\"value\":1,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.consort.value\",\"operator\":\"attribute_change\",\"value\":2,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.sway.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.character_class\",\"operator\":\"attribute_change\",\"value\":\"Speaker\",\"requirement\":\"\"}]","def_abilities":"(Sp) Air of Respectability, Arryn, Manda, Kerry, Je-zee, ?","experience_clues":"You addressed a tough challenge with deception or influence."},"flags":{},"img":"systems/scum-and-villainy/styles/assets/icons/Icon.5_53.png","effects":[]} +{"_id":"ZEbq3hXyriAWUVOl","name":"Mystic","permission":{"default":0},"type":"class","data":{"description":"A galactic wanderer in touch with the Way","logic":"[{\"attribute\":\"data.attributes.insight.skills.doctor.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.hack.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.rig.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.study.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.helm.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scramble.value\",\"operator\":\"attribute_change\",\"value\":1,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scrap.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.skulk.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.attune.value\",\"operator\":\"attribute_change\",\"value\":2,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.command.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.consort.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.sway.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.character_class\",\"operator\":\"attribute_change\",\"value\":\"Mystic\",\"requirement\":\"\"}]","def_abilities":"(My) The Way, Horux, Hicks, Laxx, Rye, Blish","experience_clues":"You addressed a tough challenge with wisdom or the Way."},"flags":{},"img":"systems/scum-and-villainy/styles/assets/icons/Icon.2_94.png","effects":[]} +{"_id":"jYEumqd1vBm5pwQv","name":"Mechanic","permission":{"default":0},"type":"class","data":{"description":"A gearhead and hacker","logic":"[{\"attribute\":\"data.attributes.insight.skills.doctor.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.hack.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.rig.value\",\"operator\":\"attribute_change\",\"value\":2,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.study.value\",\"operator\":\"attribute_change\",\"value\":1,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.helm.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scramble.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scrap.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.skulk.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.attune.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.command.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.consort.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.sway.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.character_class\",\"operator\":\"attribute_change\",\"value\":\"Mechanic\",\"requirement\":\"\"}]","def_abilities":"(Me) Tinker, Slice, Nisa, Stev, Len, Kenn","experience_clues":"You addressed a tough challenge with technical skill or ingenuity.","abilities":""},"flags":{},"img":"systems/scum-and-villainy/styles/assets/icons/Icon.3_89.png","effects":[]} +{"_id":"ppl97fxZDlMYAogz","name":"Pilot","permission":{"default":0},"type":"class","data":{"description":"A ship-handling wizard and danger addict","logic":"[{\"attribute\":\"data.attributes.insight.skills.doctor.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.hack.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.rig.value\",\"operator\":\"attribute_change\",\"value\":1,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.study.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.helm.value\",\"operator\":\"attribute_change\",\"value\":2,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scramble.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scrap.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.skulk.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.attune.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.command.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.consort.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.sway.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.character_class\",\"operator\":\"attribute_change\",\"value\":\"Pilot\",\"requirement\":\"\"}]","def_abilities":"(P) Ace Pilot, Yattu, Triv, Choss, Meris, Mav","experience_clues":"You addressed a tough challenge with speed or flair."},"flags":{},"img":"systems/scum-and-villainy/styles/assets/icons/rocket-flight.png","effects":[]} +{"_id":"q83Y3IkZfS1RhSYG","name":"Scoundrel","permission":{"default":0},"type":"class","data":{"description":"A scrappy and lucky survivor","logic":"[{\"attribute\":\"data.attributes.insight.skills.doctor.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.hack.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.rig.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.insight.skills.study.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.helm.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scramble.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.scrap.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.prowess.skills.skulk.value\",\"operator\":\"attribute_change\",\"value\":1,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.attune.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.command.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.consort.value\",\"operator\":\"attribute_change\",\"value\":0,\"requirement\":\"\"},{\"attribute\":\"data.attributes.resolve.skills.sway.value\",\"operator\":\"attribute_change\",\"value\":2,\"requirement\":\"\"},{\"attribute\":\"data.character_class\",\"operator\":\"attribute_change\",\"value\":\"Scoundrel\",\"requirement\":\"\"}]","def_abilities":"(Sc) Serendipitous, Nyx, Ora, Jal, Rhin, Battro","experience_clues":"You addressed a tough challenge with charm or audacity."},"flags":{},"img":"systems/scum-and-villainy/styles/assets/icons/Icon.4_06.png","effects":[]} diff --git a/system.json b/system.json index e3eade3..74a4646 100644 --- a/system.json +++ b/system.json @@ -2,11 +2,19 @@ "name": "scum-and-villainy", "title": "Scum and Villainy", "description": "Scum and Villainy game system.", - "version": "1.6.3", + "authors": ["megastruktur", "Andrew Garinger [agaringer#6498]"], + "url": "https://github.com/drewg13/foundryvtt-scum-and-villainy/", + "flags": {}, + "version": "1.6.4", "minimumCoreVersion": "0.7.2", - "compatibleCoreVersion": "0.8.3", - "templateVersion": 1, - "author": "megastruktur, Andrew Garinger [agaringer#6498]", + "compatibleCoreVersion": "0.8.5", + "system": [], + "dependencies": [], + "socket": false, + "manifest": "https://raw.githubusercontent.com/drewg13/foundryvtt-scum-and-villainy/master/system.json", + "download": "https://github.com/drewg13/foundryvtt-scum-and-villainy/archive/v1.6.4.zip", + "protected": false, + "scripts": [], "esmodules": [ "module/sav.js" ], @@ -21,135 +29,150 @@ "path": "lang/en.json" } ], - "url": "https://github.com/drewg13/foundryvtt-scum-and-villainy/", - "manifest": "https://raw.githubusercontent.com/drewg13/foundryvtt-scum-and-villainy/master/system.json", - "download": "https://github.com/drewg13/foundryvtt-scum-and-villainy/archive/v1.6.3.zip", "packs": [ { "name": "class", "label": "Classes", "system": "scum-and-villainy", "path": "./packs/classes.db", - "entity": "Item" + "entity": "Item", + "private": false }, { "name": "heritage", "label": "Heritages", "system": "scum-and-villainy", "path": "./packs/heritages.db", - "entity": "Item" + "entity": "Item", + "private": false }, { "name": "vice", "label": "Vices", "system": "scum-and-villainy", "path": "./packs/vices.db", - "entity": "Item" + "entity": "Item", + "private": false }, { "name": "background", "label": "Backgrounds", "system": "scum-and-villainy", "path": "./packs/backgrounds.db", - "entity": "Item" + "entity": "Item", + "private": false }, { "name": "item", "label": "Items", "system": "scum-and-villainy", "path": "./packs/items.db", - "entity": "Item" + "entity": "Item", + "private": false }, { "name": "ability", "label": "Abilities", "system": "scum-and-villainy", "path": "./packs/abilities.db", - "entity": "Item" + "entity": "Item", + "private": false }, { "name": "crew_reputation", "label": "Crew Reputation", "system": "scum-and-villainy", "path": "./packs/crew_reputation.db", - "entity": "Item" + "entity": "Item", + "private": false }, { "name": "crew_type", "label": "Ship Types", "system": "scum-and-villainy", "path": "./packs/crew_types.db", - "entity": "Item" + "entity": "Item", + "private": false }, { "name": "crew_upgrade", "label": "Ship Upgrades", "system": "scum-and-villainy", "path": "./packs/crew_upgrades.db", - "entity": "Item" + "entity": "Item", + "private": false }, { "name": "crew_ability", "label": "Ship Abilities", "system": "scum-and-villainy", "path": "./packs/crew_abilities.db", - "entity": "Item" + "entity": "Item", + "private": false }, { "name": "job_tables", "label": "Job Tables", "system": "scum-and-villainy", "path": "./packs/tables.db", - "entity": "RollTable" + "entity": "RollTable", + "private": false }, { "name": "star_system", "label": "Star Systems", "system": "scum-and-villainy", "path": "./packs/star_systems.db", - "entity": "Item" + "entity": "Item", + "private": false }, { "name": "planet", "label": "Planets", "system": "scum-and-villainy", "path": "./packs/planets.db", - "entity": "Item" + "entity": "Item", + "private": false }, { "name": "faction", "label": "Factions", "system": "scum-and-villainy", "path": "./packs/factions.db", - "entity": "Item" + "entity": "Item", + "private": false }, { "name": "ship_size", "label": "Ship Sizes", "system": "scum-and-villainy", "path": "./packs/size.db", - "entity": "Item" + "entity": "Item", + "private": false }, { "name": "wanted", "label": "Wanted Consequences", "system": "scum-and-villainy", "path": "./packs/wanted-consequences.db", - "entity": "JournalEntry" + "entity": "JournalEntry", + "private": false }, { "name": "wanted_tables", "label": "Wanted Tables", "system": "scum-and-villainy", "path": "./packs/wanted-tables.db", - "entity": "RollTable" + "entity": "RollTable", + "private": false }, { - "name": "friend", - "label": "Friends", - "system": "scum-and-villainy", - "path": "./packs/friends.db", - "entity": "Item" + "name": "friend", + "label": "Friends", + "system": "scum-and-villainy", + "path": "./packs/friends.db", + "entity": "Item", + "private": false } ] -} +} \ No newline at end of file diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 6d08b54..62aedc3 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -276,7 +276,7 @@ <nav class="tabs flex-horizontal"> <a class="item" data-tab="abilities">{{localize "BITD.Abilities"}}</a> <a class="item" data-tab="loadout">{{localize "BITD.Loadout"}}</a> - <a class="item" data-tab="friends">{{localize "BITD.Friends"}}</a> + <a class="item" data-tab="friends">{{localize "BITD.Friends"}}</a> <a class="item" data-tab="character-notes">{{localize "BITD.Notes"}}</a> <a class="item" data-tab="all-character-items">{{localize "BITD.AllItems"}}</a> </nav> @@ -285,9 +285,15 @@ <div class="label-stripe"> <p><label for="character-{{actor._id}}-experience-0">{{localize "BITD.Abilities"}}</label></p> <p><a class="item-add-popup" data-item-type="ability" data-limiter=data.character_class><i class="fas fa-plus-square"></i></a></p> - <div id="character-experience" class="teeth-experience"> - <p><span class="xp-triggers nullifier">{{localize "BITD.PExperience"}}</span></p> - <label for="character-{{actor._id}}-experience-0"><i class="fab fa-creative-commons-zero nullifier"></i></label> + <div id="character-experience" class="teeth-experience tooltip"> + <label for="character-{{actor._id}}-experience-0">{{localize "BITD.PExperience"}}<i class="fab fa-creative-commons-zero nullifier"></i> + <span class="tooltiptext delay left">{{localize "BITD.ClassExpClueDescription"}}<br />{{localize "BITD.ClassExpClue2"}}<br />{{localize "BITD.ClassExpClue3"}}<br /> + {{#each actor.items as |item id|}} + {{#if (eq item.type "class")}} + {{item.data.experience_clues}} + {{/if}} + {{/each}} + </span></label> {{#multiboxes data.experience}} <input type="radio" id="character-{{actor._id}}-experience-0" name="data.experience" value="0" dtype="Radio"> <input type="radio" id="character-{{actor._id}}-experience-1" name="data.experience" value="1" dtype="Radio"> diff --git a/templates/items/class.html b/templates/items/class.html index 0dc7186..ebcc668 100644 --- a/templates/items/class.html +++ b/templates/items/class.html @@ -14,14 +14,14 @@ <h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeh <div>{{localize "BITD.ClassExpClueDescription"}}</div> <div><i>- {{localize "BITD.ClassExpClue2"}}</i></div> <div><i>- {{localize "BITD.ClassExpClue3"}}</i></div> - <div><i>{{data.experience_clues}}</i></div><br> - <label class="label-stripe">{{localize "BITD.AddUpgrades"}}</label> + <div><i>- {{data.experience_clues}}</i></div><br> + <label class="label-stripe">{{localize "BITD.AddUpgrades"}}</label> <textarea name="data.def_abilities">{{data.def_abilities}}</textarea> {{#if isGM}} <label class="label-stripe">{{localize "BITD.Logic"}}</label> {{editor content=data.logic target="data.logic" button=true owner=owner editable=editable}} - {{/if}} + {{/if}} </section> </form> diff --git a/templates/ship-sheet.html b/templates/ship-sheet.html index bf5b615..94eb147 100644 --- a/templates/ship-sheet.html +++ b/templates/ship-sheet.html @@ -11,41 +11,40 @@ </div> <div id="ship-traits" class="flex-column"> - <div class="item-block flex-horizontal"> <div class="item-class-label"><a class="item-add-popup" data-distinct="true" data-item-type="crew_type">{{localize "BITD.CrewType"}}</a></div> - {{#each actor.items as |item id|}} - {{#if (eq item.type "crew_type")}} - <div class="item flex-horizontal" data-item-id="{{item._id}}"> - <div class="item-body flex-horizontal"> - <img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/> - <a class="item-name">{{item.name}}</a> - </div> - <a class="item-control item-delete" title="{{localize 'BITD.TitleDeleteItem'}}"><i class="fas fa-trash"></i></a> + {{#each actor.items as |item id|}} + {{#if (eq item.type "crew_type")}} + <div class="item flex-horizontal" data-item-id="{{item._id}}"> + <div class="item-body flex-horizontal"> + <img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/> + <a class="item-name">{{item.name}}</a> </div> - {{/if}} - {{/each}} + <a class="item-control item-delete" title="{{localize 'BITD.TitleDeleteItem'}}"><i class="fas fa-trash"></i></a> + </div> + {{/if}} + {{/each}} </div> - <div class="item-block flex-horizontal"> + <div class="item-block flex-horizontal"> <div class="item-class-label"><a class="item-add-popup" data-distinct="true" data-item-type="ship_size">{{localize "BITD.ShipSize"}}</a></div> {{#each actor.items as |item id|}} {{#if (eq item.type "ship_size")}} - <div class="item flex-horizontal" data-item-id="{{item._id}}"> - <div class="item-body flex-horizontal"> - <img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/> - <a class="item-name">{{item.name}}</a> + <div class="item flex-horizontal" data-item-id="{{item._id}}"> + <div class="item-body flex-horizontal"> + <img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/> + <a class="item-name">{{item.name}}</a> + </div> + <a class="item-control item-delete" title="{{localize 'BITD.TitleDeleteItem'}}"><i class="fas fa-trash"></i></a> </div> - <a class="item-control item-delete" title="{{localize 'BITD.TitleDeleteItem'}}"><i class="fas fa-trash"></i></a> - </div> {{/if}} {{/each}} </div> - <div class="item-block flex-horizontal"> + <div class="item-block flex-horizontal"> <div class="item-class-label"><a class="item-add-popup" data-distinct="true" data-item-type="crew_reputation">{{localize "BITD.CrewReputation"}}</a></div> {{#each actor.items as |item id|}} - {{#if (eq item.type "crew_reputation")}} + {{#if (eq item.type "crew_reputation")}} <div class="item flex-horizontal" data-item-id="{{item._id}}"> <div class="item-body flex-horizontal"> <img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/> @@ -53,7 +52,7 @@ </div> <a class="item-control item-delete" title="{{localize 'BITD.TitleDeleteItem'}}"><i class="fas fa-trash"></i></a> </div> - {{/if}} + {{/if}} {{/each}} </div> @@ -72,128 +71,86 @@ </div> <div id="coins" class="flex-horizontal"> - - <div id="coins-hands"> - <div class="stripe"> - <label for="coins-{{actor._id}}-hands-0">{{localize "BITD.Coin"}} - <i class="fab fa-creative-commons-zero nullifier"></i> - </label> - </div> - <div class="coins coins-hands"> - {{#multiboxes data.coins}} - <input type="radio" id="coins-{{actor._id}}-hands-0" name="data.coins" value="0"> - <input type="radio" id="coins-{{actor._id}}-hands-1" name="data.coins" value="1"> - <label for="coins-{{actor._id}}-hands-1"></label> - <input type="radio" id="coins-{{actor._id}}-hands-2" name="data.coins" value="2"> - <label for="coins-{{actor._id}}-hands-2"></label> - <input type="radio" id="coins-{{actor._id}}-hands-3" name="data.coins" value="3"> - <label for="coins-{{actor._id}}-hands-3"></label> - <input type="radio" id="coins-{{actor._id}}-hands-4" name="data.coins" value="4"> - <label for="coins-{{actor._id}}-hands-4"></label> - {{/multiboxes}} - </div> - </div> + <div id="coins-hands"> + <div class="stripe"> + <label for="coins-{{actor._id}}-hands-0">{{localize "BITD.Coin"}} <i class="fab fa-creative-commons-zero nullifier"></i></label> + </div> + <div class="coins coins-hands"> + {{#multiboxes data.coins}} + <input type="radio" id="coins-{{actor._id}}-hands-0" name="data.coins" value="0" checked="checked"> + {{#times_from_1 4}} + <input type="radio" id="coins-{{../actor._id}}-hands-{{this}}" name="data.coins" value="{{this}}"> + <label for="coins-{{../actor._id}}-hands-{{this}}"></label> + {{/times_from_1}} + {{/multiboxes}} + </div> + </div> - {{#if (eq data.installs.vault_inst 1)}} - <div id="vault"> - <div class="stripe"> - <label for="coins-{{actor._id}}-vault-0">{{localize "BITD.Vault"}} - <i class="fab fa-creative-commons-zero nullifier"></i></label> - </div> - <div class="coins coins-hands"> - {{#multiboxes data.vault}} - <input type="radio" id="coins-{{actor._id}}-vault-0" name="data.vault" value="0" checked="checked"> - <input type="radio" id="coins-{{actor._id}}-vault-1" name="data.vault" value="1"> - <label for="coins-{{actor._id}}-vault-1"></label> - <input type="radio" id="coins-{{actor._id}}-vault-2" name="data.vault" value="2"> - <label for="coins-{{actor._id}}-vault-2"></label> - <input type="radio" id="coins-{{actor._id}}-vault-3" name="data.vault" value="3"> - <label for="coins-{{actor._id}}-vault-3"></label> - <input type="radio" id="coins-{{actor._id}}-vault-4" name="data.vault" value="4"> - <label for="coins-{{actor._id}}-vault-4"></label> - {{/multiboxes}} - </div> - </div> - {{/if}} - - - <div id="coins-debt"> - - <div class="stripe"> - <label for="coins-{{actor._id}}-debt-0">{{localize "BITD.Debt"}} <i - class="fab fa-creative-commons-zero nullifier"></i></label> - </div> - <div class="coins debt"> - {{#multiboxes data.debt}} - <input type="radio" id="coins-{{actor._id}}-debt-0" name="data.debt" value="0" checked="checked"> - <input type="radio" id="coins-{{actor._id}}-debt-1" name="data.debt" value="1"> - <label for="coins-{{actor._id}}-debt-1"></label> - <input type="radio" id="coins-{{actor._id}}-debt-2" name="data.debt" value="2"> - <label for="coins-{{actor._id}}-debt-2"></label> - <input type="radio" id="coins-{{actor._id}}-debt-3" name="data.debt" value="3"> - <label for="coins-{{actor._id}}-debt-3"></label> - <input type="radio" id="coins-{{actor._id}}-debt-4" name="data.debt" value="4"> - <label for="coins-{{actor._id}}-debt-4"></label> - <input type="radio" id="coins-{{actor._id}}-debt-5" name="data.debt" value="5"> - <label for="coins-{{actor._id}}-debt-5"></label> - <input type="radio" id="coins-{{actor._id}}-debt-6" name="data.debt" value="6"> - <label for="coins-{{actor._id}}-debt-6"></label> - <input type="radio" id="coins-{{actor._id}}-debt-7" name="data.debt" value="7"> - <label for="coins-{{actor._id}}-debt-7"></label> - <input type="radio" id="coins-{{actor._id}}-debt-8" name="data.debt" value="8"> - <label for="coins-{{actor._id}}-debt-8"></label> - {{/multiboxes}} - </div> - - </div> - + {{#if (eq data.installs.vault_inst 1)}} + <div id="vault"> + <div class="stripe"> + <label for="coins-{{actor._id}}-vault-0">{{localize "BITD.Vault"}} <i class="fab fa-creative-commons-zero nullifier"></i></label> + </div> + <div class="coins coins-hands"> + {{#multiboxes data.vault}} + <input type="radio" id="coins-{{actor._id}}-vault-0" name="data.vault" value="0" checked="checked"> + {{#times_from_1 4}} + <input type="radio" id="coins-{{../actor._id}}-vault-{{this}}" name="data.vault" value="{{this}}"> + <label for="coins-{{../actor._id}}-vault-{{this}}"></label> + {{/times_from_1}} + {{/multiboxes}} + </div> + </div> + {{/if}} - </div> + <div id="coins-debt"> + <div class="stripe"> + <label for="coins-{{actor._id}}-debt-0">{{localize "BITD.Debt"}} <i class="fab fa-creative-commons-zero nullifier"></i></label> + </div> + <div class="coins debt"> + {{#multiboxes data.debt}} + <input type="radio" id="coins-{{actor._id}}-debt-0" name="data.debt" value="0" checked="checked"> + {{#times_from_1 8}} + <input type="radio" id="coins-{{../actor._id}}-debt-{{this}}" name="data.debt" value="{{this}}"> + <label for="coins-{{../actor._id}}-debt-{{this}}"></label> + {{/times_from_1}} + {{/multiboxes}} + </div> + </div> + </div> - <div id="gambits" class="flex-horizontal"> + <div id="gambits-container" class="flex-horizontal"> + <div id="gambits"> + <div class="stripe"> + <label for="gambits-{{actor._id}}-0">{{localize "BITD.Gambits"}} + <i class="fab fa-creative-commons-zero nullifier"></i> ({{localize "BITD.GambitRefresh1"}} {{data.gambits.refresh}} {{localize "BITD.GambitRefresh2"}}) + </label> + </div> + <div class="coins gambits"> + {{#multiboxes data.gambits.value}} + <input type="radio" id="gambits-{{actor._id}}-0" name="data.gambits.value" value="0" checked="checked"> + {{#times_from_1 8}} + <input type="radio" id="gambits-{{../actor._id}}-{{this}}" name="data.gambits.value" value="{{this}}"> + <label for="gambits-{{../actor._id}}-{{this}}"></label> + {{/times_from_1}} + {{/multiboxes}} + </div> + </div> + </div> - <div id="gambits"> - <div class="stripe"> - <label for="gambits-{{actor._id}}-0">{{localize "BITD.Gambits"}} - <i class="fab fa-creative-commons-zero nullifier"></i> ({{localize "BITD.GambitRefresh1"}} {{data.gambits.refresh}} {{localize "BITD.GambitRefresh2"}})</label> - </div> - <div class="coins gambits"> - {{#multiboxes data.gambits.value}} - <input type="radio" id="gambits-{{actor._id}}-0" name="data.gambits.value" value="0" checked="checked"> - <input type="radio" id="gambits-{{actor._id}}-1" name="data.gambits.value" value="1"> - <label for="gambits-{{actor._id}}-1"></label> - <input type="radio" id="gambits-{{actor._id}}-2" name="data.gambits.value" value="2"> - <label for="gambits-{{actor._id}}-2"></label> - <input type="radio" id="gambits-{{actor._id}}-3" name="data.gambits.value" value="3"> - <label for="gambits-{{actor._id}}-3"></label> - <input type="radio" id="gambits-{{actor._id}}-4" name="data.gambits.value" value="4"> - <label for="gambits-{{actor._id}}-4"></label> - <input type="radio" id="gambits-{{actor._id}}-5" name="data.gambits.value" value="5"> - <label for="gambits-{{actor._id}}-5"></label> - <input type="radio" id="gambits-{{actor._id}}-6" name="data.gambits.value" value="6"> - <label for="gambits-{{actor._id}}-6"></label> - <input type="radio" id="gambits-{{actor._id}}-7" name="data.gambits.value" value="7"> - <label for="gambits-{{actor._id}}-7"></label> - <input type="radio" id="gambits-{{actor._id}}-8" name="data.gambits.value" value="8"> - <label for="gambits-{{actor._id}}-8"></label> - {{/multiboxes}} - </div> - </div> </div> - </section> {{!-- Attributes --}} <section class="flex-horizontal"> <div class="tab-content flex-vertical grow-two"> - {{!-- Nav menu --}} <nav class="tabs flex-horizontal"> <a class="item" data-tab="abilities">{{localize "BITD.SpecialAbilities"}}</a> <a class="item" data-tab="upgrades">{{localize "BITD.Upgrades"}}</a> - <a class="item" data-tab="friends">{{localize "BITD.Contacts"}}</a> - <a class="item" data-tab="character-notes">{{localize "BITD.Notes"}}</a> + <a class="item" data-tab="friends">{{localize "BITD.Contacts"}}</a> + <a class="item" data-tab="character-notes">{{localize "BITD.Notes"}}</a> <a class="item" data-tab="all-character-items">{{localize "BITD.AllItems"}}</a> </nav> @@ -201,44 +158,38 @@ <div class="label-stripe"> <p>{{localize "BITD.SpecialAbilities"}}</p> <p><a class="item-add-popup" data-item-type="crew_ability" data-limiter=data.ship_class><i class="fas fa-plus-square"></i></a></p> - <div id="crew_experience" class="teeth-experience"> - <p><span class="xp-triggers nullifier">{{localize "BITD.CExperience"}}</span></p> - <label class="nullifier" for="ship-{{actor._id}}-experience-0"><i class="fab fa-creative-commons-zero nullifier"></i></label> + <div id="character-experience" class="teeth-experience tooltip"> + <label for="character-{{actor._id}}-experience-0">{{localize "BITD.PExperience"}}<i class="fab fa-creative-commons-zero nullifier"></i> + <span class="tooltiptext delay left">{{localize "BITD.ClassExpClueDescription"}}<br />{{localize "BITD.ClassExpClue2"}}<br />{{localize "BITD.ClassExpClue3"}}<br /> + {{#each actor.items as |item id|}} + {{#if (eq item.type "crew_type")}} + {{item.data.experience_clues}} + {{/if}} + {{/each}} + </span> + </label> {{#multiboxes data.crew_experience}} - <input type="radio" id="ship-{{actor._id}}-experience-0" name="data.crew_experience" value="0" dtype="Radio"> - <input type="radio" id="ship-{{actor._id}}-experience-1" name="data.crew_experience" value="1" dtype="Radio"> - <label for="ship-{{actor._id}}-experience-1"></label> - <input type="radio" id="ship-{{actor._id}}-experience-2" name="data.crew_experience" value="2" dtype="Radio"> - <label for="ship-{{actor._id}}-experience-2"></label> - <input type="radio" id="ship-{{actor._id}}-experience-3" name="data.crew_experience" value="3" dtype="Radio"> - <label for="ship-{{actor._id}}-experience-3"></label> - <input type="radio" id="ship-{{actor._id}}-experience-4" name="data.crew_experience" value="4" dtype="Radio"> - <label for="ship-{{actor._id}}-experience-4"></label> - <input type="radio" id="ship-{{actor._id}}-experience-5" name="data.crew_experience" value="5" dtype="Radio"> - <label for="ship-{{actor._id}}-experience-5"></label> - <input type="radio" id="ship-{{actor._id}}-experience-6" name="data.crew_experience" value="6" dtype="Radio"> - <label for="ship-{{actor._id}}-experience-6"></label> - <input type="radio" id="ship-{{actor._id}}-experience-7" name="data.crew_experience" value="7" dtype="Radio"> - <label for="ship-{{actor._id}}-experience-7"></label> - <input type="radio" id="ship-{{actor._id}}-experience-8" name="data.crew_experience" value="8" dtype="Radio"> - <label for="ship-{{actor._id}}-experience-8"></label> + <input type="radio" id="ship-{{actor._id}}-experience-0" name="data.crew_experience" value="0" dtype="Radio"> + {{#times_from_1 8}} + <input type="radio" id="ship-{{../actor._id}}-experience-{{this}}" name="data.crew_experience" value="{{this}}" dtype="Radio"> + <label for="ship-{{../actor._id}}-experience-{{this}}"></label> + {{/times_from_1}} {{/multiboxes}} </div> - - </div> + </div> <div id="abilities-list"> {{#each actor.items as |item id|}} - {{#if (eq item.type "crew_ability")}} - <div class="item flex-horizontal" data-item-id="{{item._id}}"> - <div class="item-body flex-horizontal"> - <img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/> - <a class="item-name">{{item.name}}</a> - <div class="item-description">{{item.data.description}}</div> + {{#if (eq item.type "crew_ability")}} + <div class="item flex-horizontal" data-item-id="{{item._id}}"> + <div class="item-body flex-horizontal"> + <img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/> + <a class="item-name">{{item.name}}</a> + <div class="item-description">{{item.data.description}}</div> + </div> + <a class="item-control item-delete" title="{{localize 'BITD.TitleDeleteItem'}}"><i class="fas fa-trash"></i></a> </div> - <a class="item-control item-delete" title="{{localize 'BITD.TitleDeleteItem'}}"><i class="fas fa-trash"></i></a> - </div> - {{/if}} + {{/if}} {{/each}} <div class="item-class-label"><a class="item-add-popup" data-item-type="crew_ability">{{localize "BITD.AddAbility"}}</a></div> </div> @@ -252,51 +203,46 @@ </div> <div> {{#each actor.items as |item id|}} - {{#if (eq item.type "crew_upgrade")}} - <div class="item flex-horizontal" data-item-id="{{item._id}}"> - <div class="item-body flex-horizontal"> - <img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/> - <a class="item-name">{{item.name}}</a> - <div class="item-description">{{item.data.description}}</div> + {{#if (eq item.type "crew_upgrade")}} + <div class="item flex-horizontal" data-item-id="{{item._id}}"> + <div class="item-body flex-horizontal"> + <img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/> + <a class="item-name">{{item.name}}</a> + <div class="item-description">{{item.data.description}}</div> + </div> + <a class="item-control item-delete" title="{{localize 'BITD.TitleDeleteItem'}}"><i class="fas fa-trash"></i></a> </div> - <a class="item-control item-delete" title="{{localize 'BITD.TitleDeleteItem'}}"><i class="fas fa-trash"></i></a> - </div> - {{/if}} + {{/if}} {{/each}} <div class="item-class-label"><a class="item-add-popup" data-item-type="crew_upgrade">{{localize "BITD.AddUpgrade"}}</a></div> </div> </div> - {{!-- Friends Tab --}} + {{!-- Friends Tab --}} <div id="friends" class="tab flex-vertical" data-tab="friends"> - - <div class="label-stripe"> - <p>{{localize "BITD.Contacts"}}</p> + <div class="label-stripe"> + <p>{{localize "BITD.Contacts"}}</p> <p><a class="item-add-popup" data-item-type="friend"><i class="fas fa-plus-square"></i></a></p> </div> <div id="friend-list"> {{#each actor.items as |item id|}} - {{#if (eq item.type "friend")}} - <div class="friend-tracker"> - {{#multiboxes item.data.status.value}} - <input class="update-box" data-utype="status" data-item="{{item._id}}" data-value="0" type="radio" id="friend-{{item._id}}-status-0" value="0" dtype="Radio"> - <label for="friend-{{item._id}}-status-0"></label> - <input class="update-box" data-utype="status" data-item="{{item._id}}" data-value="1" type="radio" id="friend-{{item._id}}-status-1" value="1" dtype="Radio"> - <label for="friend-{{item._id}}-status-1"></label> - <input class="update-box" data-utype="status" data-item="{{item._id}}" data-value="2" type="radio" id="friend-{{item._id}}-status-2" value="2" dtype="Radio"> - <label for="friend-{{item._id}}-status-2"></label> - {{/multiboxes}} - - <div class="item flex-horizontal" data-item-id="{{item._id}}"> - <div class="item-body flex-horizontal"> - <!--<img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/>--> - <a class="item-name">{{item.name}}</a> - <div class="item-description">{{item.data.description}}</div> - </div> - <a class="item-control item-delete" title="{{localize 'BITD.TitleDeleteItem'}}"><i class="fas fa-trash"></i></a> - </div> - </div> - {{/if}} + {{#if (eq item.type "friend")}} + <div class="friend-tracker"> + {{#multiboxes item.data.status.value}} + {{#times_from_0 2}} + <input class="update-box" data-utype="status" data-item="{{item._id}}" data-value="{{this}}" type="radio" id="friend-{{item._id}}-status-{{this}}" value="{{this}}" dtype="Radio"> + <label for="friend-{{item._id}}-status-{{this}}"></label> + {{/times_from_0}} + {{/multiboxes}} + <div class="item flex-horizontal" data-item-id="{{item._id}}"> + <div class="item-body flex-horizontal"> + <a class="item-name">{{item.name}}</a> + <div class="item-description">{{item.data.description}}</div> + </div> + <a class="item-control item-delete" title="{{localize 'BITD.TitleDeleteItem'}}"><i class="fas fa-trash"></i></a> + </div> + </div> + {{/if}} {{/each}} <div class="item-class-label"><a class="item-add-popup" data-item-type="friend">{{localize "BITD.AddFriend"}}</a></div> </div> @@ -307,8 +253,8 @@ <p>{{localize "BITD.Notes"}}</p> </div> {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} - {{#if editable}} - <button type="submit" name="submit"><i class="fas fa-feather-alt"></i> {{localize "JOURNAL.Submit"}}</button> + {{#if editable}} + <button type="submit" name="submit"><i class="fas fa-feather-alt"></i> {{localize "JOURNAL.Submit"}}</button> {{/if}} </div> @@ -318,182 +264,118 @@ <p><label>{{localize "BITD.AllItems"}}</label></p> </div> {{#each actor.items as |item id|}} - <div class="item flex-horizontal" data-item-id="{{item._id}}"> - <div class="item-body item-sheet-open flex-horizontal"> - <img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/> - <a class="item-name">{{item.name}}</a> + <div class="item flex-horizontal" data-item-id="{{item._id}}"> + <div class="item-body item-sheet-open flex-horizontal"> + <img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/> + <a class="item-name">{{item.name}}</a> + </div> + <a class="item-control item-delete" title="{{localize 'BITD.TitleDeleteItem'}}"><i class="fas fa-trash"></i></a> </div> - <a class="item-control item-delete" title="{{localize 'BITD.TitleDeleteItem'}}"><i class="fas fa-trash"></i></a> - </div> {{/each}} </div> - </div> - {{!-- Attributes --}} - <div id="systems"> - {{#each data.systems as |system system_name|}} - {{#unless (eq system.max 0)}} - <div id="systems-{{system_name}}" class="system"> - <div id="systems-{{system_name}}-title" class="systems-value"> - <div class="stripe flex-horizontal system-label"> - {{#if (eq system_name "upkeep")}} - <a class="roll-die-attribute rollable-text tooltip" data-roll-attribute="{{system_name}}">{{localize (concat system.label 'Short')}}<span class="tooltiptext delay left">{{{localize system.tip}}}</span></a><span style="margin-right: 5px;"> = {{system.value}} {{localize "BITD.Coin"}}</span> - {{/if}} - {{#if (eq system_name "shields")}} - <span class="tooltip">{{localize (concat system.label 'Short')}}<span class="tooltiptext delay left">{{{localize system.tip}}}</span></span> - {{/if}} - {{#if (eq system_name "encryptor")}} - <span class="tooltip">{{localize (concat system.label 'Short')}}<span class="tooltiptext delay left">{{{localize system.tip}}}</span></span> - {{/if}} - {{#unless (eq system_name "upkeep")}} - {{#unless (eq system_name "shields")}} - {{#unless (eq system_name "encryptor")}} - <a class="system-label roll-die-attribute rollable-text tooltip" data-roll-attribute="{{system_name}}">{{localize (concat system.label 'Short')}}<span class="tooltiptext delay left">{{{localize system.tip}}}</span></a> - {{/unless}} - {{/unless}} - {{/unless}} - {{#unless (eq system_name "upkeep")}} - <div class="stripe-tooth-body-blue"> - {{#multiboxes system.value}} - - <label for="{{../actor._id}}-{{system_name}}-value-0"><i class="fab fa-creative-commons-zero nullifier"></i></label> - <input type="radio" id="{{../actor._id}}-{{system_name}}-value-0" - name="data.systems.{{system_name}}.value" value="0" checked="checked"> - - {{#if (eq system.max 1)}} - {{#times_from_1 1}} - <input type="radio" id="{{../../actor._id}}-{{system_name}}-value-{{this}}" - name="data.systems.{{system_name}}.value" value="{{this}}"> - <label for="{{../../actor._id}}-{{system_name}}-value-{{this}}"></label> - {{/times_from_1}} - {{/if}} - - {{#if (eq system.max 2)}} - {{#times_from_1 2}} - <input type="radio" id="{{../../actor._id}}-{{system_name}}-value-{{this}}" - name="data.systems.{{system_name}}.value" value="{{this}}"> - <label for="{{../../actor._id}}-{{system_name}}-value-{{this}}"></label> - {{/times_from_1}} - {{/if}} - - {{#if (eq system.max 3)}} - {{#times_from_1 3}} - <input type="radio" id="{{../../actor._id}}-{{system_name}}-value-{{this}}" - name="data.systems.{{system_name}}.value" value="{{this}}"> - <label for="{{../../actor._id}}-{{system_name}}-value-{{this}}"></label> - {{/times_from_1}} - {{/if}} - - {{#if (eq system.max 4)}} - {{#times_from_1 4}} - <input type="radio" id="{{../../actor._id}}-{{system_name}}-value-{{this}}" - name="data.systems.{{system_name}}.value" value="{{this}}"> - <label for="{{../../actor._id}}-{{system_name}}-value-{{this}}"></label> - {{/times_from_1}} - {{/if}} - - {{/multiboxes}} - </div> - {{/unless}} - </div> - </div> - {{#unless (eq system_name "crew")}} - {{#unless (eq system_name "shields")}} - {{#unless (eq system_name "encryptor")}} - <div id="systems-{{system_name}}-damage" class="systems-value"> - <div class="stripe-damage flex-horizontal system-label-damage"> - {{#if (eq system_name "upkeep")}} - {{localize "BITD.SystemsSkips"}} - {{/if}} - {{#unless (eq system_name "upkeep")}} - {{localize "BITD.SystemsDamage"}} - {{/unless}} - - <div class="stripe-tooth-body-red"> - {{#multiboxes system.damage}} - - <label - for="{{../actor._id}}-{{system_name}}-damage-0"><i - class="fab fa-creative-commons-zero nullifier"></i></label> - <input type="radio" id="{{../actor._id}}-{{system_name}}-damage-0" - name="data.systems.{{system_name}}.damage" value="0" checked="checked"> - - {{#if (eq system.max 1)}} - {{#times_from_1 1}} - <input type="radio" id="{{../../actor._id}}-{{system_name}}-damage-{{this}}" - name="data.systems.{{system_name}}.damage" value="{{this}}"> - <label for="{{../../actor._id}}-{{system_name}}-damage-{{this}}"></label> - {{/times_from_1}} - {{/if}} - - {{#if (eq system.max 2)}} - {{#times_from_1 2}} - <input type="radio" id="{{../../actor._id}}-{{system_name}}-damage-{{this}}" - name="data.systems.{{system_name}}.damage" value="{{this}}"> - <label for="{{../../actor._id}}-{{system_name}}-damage-{{this}}"></label> - {{/times_from_1}} - {{/if}} - - {{#if (eq system.max 3)}} - {{#times_from_1 3}} - <input type="radio" id="{{../../actor._id}}-{{system_name}}-damage-{{this}}" - name="data.systems.{{system_name}}.damage" value="{{this}}"> - <label for="{{../../actor._id}}-{{system_name}}-damage-{{this}}"></label> - {{/times_from_1}} - {{/if}} - - {{#if (eq system.max 4)}} - {{#times_from_1 4}} - <input type="radio" id="{{../../actor._id}}-{{system_name}}-damage-{{this}}" - name="data.systems.{{system_name}}.damage" value="{{this}}"> - <label for="{{../../actor._id}}-{{system_name}}-damage-{{this}}"></label> - {{/times_from_1}} - {{/if}} - - {{/multiboxes}} - </div> - </div> - </div> - - <div id="system-upgrades" class="systems-value"> - {{#each ../actor.items as |item id|}} - - {{#if (eq item.type "crew_upgrade")}} - - {{#if (caseeq item.data.class system_name)}} - <div class="label-stripe-gray item flex-horizontal system-label" data-item-id="{{item._id}}"> - <div class="item-body"> - <a class="item-name">{{item.name}}</a> - - </div> - <div id="system-subitem" class="stripe-tooth-body-red"> - <label for="item-{{id}}-0"><i class="fab fa-creative-commons-zero nullifier"></i></label> - {{#multiboxes item.data.is_damaged}} - <input class="update-box" data-utype="is_damaged" data-item="{{item._id}}" data-value="0" type="radio" id="item-{{id}}-0" value="0" dtype="Radio"> - {{#times_from_1 1}} - <input class="update-box" data-utype="is_damaged" data-item="{{item._id}}" data-value="{{this}}" type="radio" id="item-{{id}}-{{this}}" value="{{this}}" dtype="Radio"> - <label for="item-{{id}}-{{this}}"></label> - {{/times_from_1}} - {{/multiboxes}} - </div> - - </div> - {{/if}} - {{/if}} - {{/each}} - </div> - - {{/unless}} - {{/unless}} - {{/unless}} - - </div> - <br> - {{/unless}} - {{/each}} + {{!-- Attributes --}} + <div id="systems"> + {{#each data.systems as |system system_name|}} + {{#unless (eq system.max 0)}} + <div id="systems-{{system_name}}" class="system"> + <div id="systems-{{system_name}}-title" class="systems-value"> + <div class="stripe flex-horizontal system-label"> + {{#if (eq system_name "upkeep")}} + <a class="roll-die-attribute rollable-text tooltip" data-roll-attribute="{{system_name}}">{{localize (concat system.label 'Short')}} + <span class="tooltiptext delay left">{{{localize system.tip}}}</span> + </a> + <span style="margin-right: 5px;"> = {{system.value}} {{localize "BITD.Coin"}}</span> + {{/if}} + {{#if (eq system_name "shields")}} + <span class="tooltip">{{localize (concat system.label 'Short')}} + <span class="tooltiptext delay left">{{{localize system.tip}}}</span> + </span> + {{/if}} + {{#if (eq system_name "encryptor")}} + <span class="tooltip">{{localize (concat system.label 'Short')}} + <span class="tooltiptext delay left">{{{localize system.tip}}}</span> + </span> + {{/if}} + {{#unless (eq system_name "upkeep")}} + {{#unless (eq system_name "shields")}} + {{#unless (eq system_name "encryptor")}} + <a class="system-label roll-die-attribute rollable-text tooltip" data-roll-attribute="{{system_name}}">{{localize (concat system.label 'Short')}} + <span class="tooltiptext delay left">{{{localize system.tip}}}</span> + </a> + {{/unless}} + {{/unless}} + {{/unless}} + {{#unless (eq system_name "upkeep")}} + <div class="stripe-tooth-body-blue"> + {{#multiboxes system.value}} + <label for="{{../actor._id}}-{{system_name}}-value-0"><i class="fab fa-creative-commons-zero nullifier"></i></label> + <input type="radio" id="{{../actor._id}}-{{system_name}}-value-0" name="data.systems.{{system_name}}.value" value="0" checked="checked"> + {{#times_from_1 system.max}} + <input type="radio" id="{{../../actor._id}}-{{system_name}}-value-{{this}}" name="data.systems.{{system_name}}.value" value="{{this}}"> + <label for="{{../../actor._id}}-{{system_name}}-value-{{this}}"></label> + {{/times_from_1}} + {{/multiboxes}} + </div> + {{/unless}} + </div> + </div> + {{#unless (eq system_name "crew")}} + {{#unless (eq system_name "shields")}} + {{#unless (eq system_name "encryptor")}} + <div id="systems-{{system_name}}-damage" class="systems-value"> + <div class="stripe-damage flex-horizontal system-label-damage"> + {{#if (eq system_name "upkeep")}} + {{localize "BITD.SystemsSkips"}} + {{/if}} + {{#unless (eq system_name "upkeep")}} + {{localize "BITD.SystemsDamage"}} + {{/unless}} + <div class="stripe-tooth-body-red"> + {{#multiboxes system.damage}} + <label for="{{../actor._id}}-{{system_name}}-damage-0"><i class="fab fa-creative-commons-zero nullifier"></i></label> + <input type="radio" id="{{../actor._id}}-{{system_name}}-damage-0" name="data.systems.{{system_name}}.damage" value="0" checked="checked"> + {{#times_from_1 system.max}} + <input type="radio" id="{{../../actor._id}}-{{system_name}}-damage-{{this}}" name="data.systems.{{system_name}}.damage" value="{{this}}"> + <label for="{{../../actor._id}}-{{system_name}}-damage-{{this}}"></label> + {{/times_from_1}} + {{/multiboxes}} + </div> + </div> + </div> + <div id="system-upgrades" class="systems-value"> + {{#each ../actor.items as |item id|}} + {{#if (eq item.type "crew_upgrade")}} + {{#if (caseeq item.data.class system_name)}} + <div class="label-stripe-gray item flex-horizontal system-label" data-item-id="{{item._id}}"> + <div class="item-body"> + <a class="item-name">{{item.name}}</a> + </div> + <div id="system-subitem" class="stripe-tooth-body-red"> + <label for="item-{{id}}-0"><i class="fab fa-creative-commons-zero nullifier"></i></label> + {{#multiboxes item.data.is_damaged}} + <input class="update-box" data-utype="is_damaged" data-item="{{item._id}}" data-value="0" type="radio" id="item-{{id}}-0" value="0" dtype="Radio"> + {{#times_from_1 1}} + <input class="update-box" data-utype="is_damaged" data-item="{{item._id}}" data-value="{{this}}" type="radio" id="item-{{id}}-{{this}}" value="{{this}}" dtype="Radio"> + <label for="item-{{id}}-{{this}}"></label> + {{/times_from_1}} + {{/multiboxes}} + </div> + </div> + {{/if}} + {{/if}} + {{/each}} + </div> + {{/unless}} + {{/unless}} + {{/unless}} + </div> + <br> + {{/unless}} + {{/each}} - </div> + </div> </section> </form>