diff --git a/module/actor/actor.js b/module/actor/actor.js index 239da08..18d625d 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -49,7 +49,7 @@ export default class DeltaGreenActor extends Actor { actorData.system.health.protection = protection; - //console.log(actor); + // console.log(actor); } _prepareNpcData(actor) { @@ -74,7 +74,7 @@ export default class DeltaGreenActor extends Actor { try { system.health.max = Math.ceil( - (system.statistics.con.value + system.statistics.str.value) / 2 + (system.statistics.con.value + system.statistics.str.value) / 2, ); } catch (ex) { system.health.max = 10; @@ -227,7 +227,7 @@ export default class DeltaGreenActor extends Actor { system.wp.max = system.statistics.pow.value; system.health.max = Math.ceil( - (system.statistics.con.value + system.statistics.str.value) / 2 + (system.statistics.con.value + system.statistics.str.value) / 2, ); // initialize sanity, don't set these afterwards, as they need to be manually edited @@ -307,7 +307,7 @@ export default class DeltaGreenActor extends Actor { -1 * Math.abs(system.physical.exhaustedPenalty); } - //console.log(agent); + // console.log(agent); } /** @override */ @@ -319,9 +319,9 @@ export default class DeltaGreenActor extends Actor { { actorLink: true, // this will make the 'Link Actor Data' option for a token is checked by default. So changes to the token sheet will reflect to the actor sheet. sight: { enabled: true }, - disposition: 1 // friendly, this is a dangerous assumption to make in the agency + disposition: 1, // friendly, this is a dangerous assumption to make in the agency }, - { overwrite: false } + { overwrite: false }, ); } return super.create(data, options); @@ -345,7 +345,7 @@ export default class DeltaGreenActor extends Actor { } const handToHandPack = await game.packs.get( - "deltagreen.hand-to-hand-weapons" + "deltagreen.hand-to-hand-weapons", ); const itemIndex = await handToHandPack.getIndex(); const toAdd = []; // createEmbeddedDocument expects an array @@ -413,16 +413,16 @@ export default class DeltaGreenActor extends Actor { description, protection, isEquipped, - expense = "NA" + expense = "NA", ) { const armorData = { type: "armor", - name: name, + name, system: { - description: description, - protection: protection, + description, + protection, equipped: isEquipped, - expense: expense, + expense, }, }; @@ -443,25 +443,25 @@ export default class DeltaGreenActor extends Actor { killRadius = "N/A", ammo = "", expense = "NA", - equipped = true + equipped = true, ) { const weaponData = { type: "weapon", - name: name, + name, system: { - description: description, - skill: skill, //custom - skillModifier: skillModifier, - customSkillTarget: customSkillTarget, - range: range, - damage: damage, - armorPiercing: armorPiercing, - lethality: lethality, - isLethal: isLethal, - killRadius: killRadius, - ammo: ammo, - expense: expense, - equipped: equipped, + description, + skill, // custom + skillModifier, + customSkillTarget, + range, + damage, + armorPiercing, + lethality, + isLethal, + killRadius, + ammo, + expense, + equipped, }, }; diff --git a/module/item/item-sheet.js b/module/item/item-sheet.js index 0d9df28..7f5077e 100644 --- a/module/item/item-sheet.js +++ b/module/item/item-sheet.js @@ -44,14 +44,14 @@ export default class DeltaGreenItemSheet extends foundry.appv1.sheets data.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML( this.object.system.description, - { async: true } + { async: true }, ); if (data.item.type === "tome" || data.item.type === "ritual") { data.enrichedHandlerNotes = await foundry.applications.ux.TextEditor.implementation.enrichHTML( this.object.system.handlerNotes, - { async: true } + { async: true }, ); } @@ -110,11 +110,11 @@ export default class DeltaGreenItemSheet extends foundry.appv1.sheets return; } - //const item = this.actor.items.get(dataset.iid); + // const item = this.actor.items.get(dataset.iid); const rollOptions = { rollType: dataset.rolltype, key: dataset.key, - //actor: this, + // actor: this, specialTrainingName: dataset?.name || null, // Only applies to Special Training Rolls item: this, }; diff --git a/module/item/item.js b/module/item/item.js index ef40f62..1beafa7 100644 --- a/module/item/item.js +++ b/module/item/item.js @@ -45,7 +45,7 @@ export default class DeltaGreenItem extends Item { } if (isCrit) { - diceFormula = "2*(" + diceFormula + ")"; + diceFormula = `2*(${diceFormula})`; } roll = new DGDamageRoll( diff --git a/module/other/inline.js b/module/other/inline.js index eb22e10..6070c88 100644 --- a/module/other/inline.js +++ b/module/other/inline.js @@ -1,26 +1,25 @@ export async function handleInlineActions(btnWithAction, messageId) { - let action = btnWithAction.dataset?.action; - let message = game.messages.get(messageId); - let actor = message?.speakerActor; + const action = btnWithAction.dataset?.action; + const message = game.messages.get(messageId); + const actor = message?.speakerActor; if (!actor) return; - if (action === 'rollback-skill-failure-state') { + if (action === "rollback-skill-failure-state") { const rollbackFlag = message.getFlag("deltagreen", "rollbacks"); await actor.update(foundry.utils.deepClone(rollbackFlag)); - toggleAllSkillFailures(rollbackFlag) + toggleAllSkillFailures(rollbackFlag); const label = btnWithAction .closest(".rollback-section") ?.querySelector("label"); const oldHtml = label.outerHTML; - label.classList.toggle('strike'); + label.classList.toggle("strike"); message.update({ [`flags.deltagreen.rollbacks`]: rollbackFlag, - content: message.content - .replace(oldHtml, label.outerHTML) - }) + content: message.content.replace(oldHtml, label.outerHTML), + }); } } @@ -31,4 +30,4 @@ function toggleAllSkillFailures(data) { for (const skill of Object.values(data.system?.typedSkills || {})) { skill.failure = !skill.failure; } -} \ No newline at end of file +} diff --git a/module/other/macro-functions.js b/module/other/macro-functions.js index 4b55d29..ca07416 100644 --- a/module/other/macro-functions.js +++ b/module/other/macro-functions.js @@ -44,13 +44,11 @@ export async function createDeltaGreenMacro(data, slot) { type: "script", img: item.img, thumbnail: item.img, - command: command, + command, flags: { "deltagreen.itemMacro": true }, }); await game.user.assignHotbarMacro(macro, slot); - - return; } /** diff --git a/module/other/stat-parser-macro.js b/module/other/stat-parser-macro.js index f413db7..97e4684 100644 --- a/module/other/stat-parser-macro.js +++ b/module/other/stat-parser-macro.js @@ -13,7 +13,7 @@ function GetAttacksFromInput(inputText) { let isInAttackSection = false; if (lines !== null && lines.length > 0) { - for (var i = 0; i < lines.length; i++) { + for (let i = 0; i < lines.length; i++) { if (lines[i].toString().toUpperCase().indexOf("ATTACKS:") >= 0) { isInAttackSection = true; } else if ( @@ -142,8 +142,8 @@ function GetNotesFromInput(inputText) { const lines = results[0].split(/\r?\n/); - for (var i = 0; i < lines.length; i++) { - output += lines[i] + "
"; + for (let i = 0; i < lines.length; i++) { + output += `${lines[i]}
`; } notes = output; @@ -158,12 +158,12 @@ function GetNotesFromInput(inputText) { function GetArmorFromInput(inputText) { try { - let armor = { name: "Armor", description: "", armor: 0 }; + const armor = { name: "Armor", description: "", armor: 0 }; const lines = inputText.split(/\r?\n/); if (lines !== null && lines.length > 0) { - for (var i = 0; i < lines.length; i++) { + for (let i = 0; i < lines.length; i++) { if (lines[i].toString().toUpperCase().indexOf("ARMOR:") >= 0) { armor.description = lines[i] .replace("Armor:", "") @@ -316,9 +316,9 @@ async function RegexParseNpcStatBlock(inputStr, actorType) { actorData.name = "Unknown"; } - let armor = GetArmorFromInput(inputStr); + const armor = GetArmorFromInput(inputStr); - let attacks = GetAttacksFromInput(inputStr); + const attacks = GetAttacksFromInput(inputStr); if (armor !== null) { console.log(armor); diff --git a/module/settings.js b/module/settings.js index 24bfba1..8977f07 100644 --- a/module/settings.js +++ b/module/settings.js @@ -256,7 +256,7 @@ class HandlerSettings extends SettingForm { type: String, choices: DG.skillImprovementFormulas, default: "d4", - } + }, }; } }