fix auto-fixable linting/formatting errors

This commit is contained in:
jalensailin
2025-08-26 16:35:09 -04:00
parent ca9497106c
commit 8082eb0bf4
7 changed files with 50 additions and 53 deletions
+27 -27
View File
@@ -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,
},
};
+4 -4
View File
@@ -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,
};
+1 -1
View File
@@ -45,7 +45,7 @@ export default class DeltaGreenItem extends Item {
}
if (isCrit) {
diceFormula = "2*(" + diceFormula + ")";
diceFormula = `2*(${diceFormula})`;
}
roll = new DGDamageRoll(
+9 -10
View File
@@ -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;
}
}
}
+1 -3
View File
@@ -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;
}
/**
+7 -7
View File
@@ -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] + "<br>";
for (let i = 0; i < lines.length; i++) {
output += `${lines[i]}<br>`;
}
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);
+1 -1
View File
@@ -256,7 +256,7 @@ class HandlerSettings extends SettingForm {
type: String,
choices: DG.skillImprovementFormulas,
default: "d4",
}
},
};
}
}