Adding Prettier

* Added prettier with automatic useage on pre-commit to avoid style breakage
* Ran Prettier on the project
This commit is contained in:
WBHarry 2025-05-23 18:57:50 +02:00 committed by GitHub
parent 820c2df1f4
commit b24cdcc9ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
136 changed files with 13929 additions and 12206 deletions

View file

@ -1,11 +1,11 @@
import { GMUpdateEvent, socketEvent } from "../helpers/socket.mjs";
import { GMUpdateEvent, socketEvent } from '../helpers/socket.mjs';
export default class DhpCombat extends Combat {
_sortCombatants(a, b) {
if(a.isNPC !== b.isNPC){
if (a.isNPC !== b.isNPC) {
const aVal = a.isNPC ? 0 : 1;
const bVal = b.isNPC ? 0 : 1;
return aVal - bVal;
}
@ -13,20 +13,23 @@ export default class DhpCombat extends Combat {
}
async useActionToken(combatantId) {
const automateActionPoints = await game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Automation.ActionPoints);
const automateActionPoints = await game.settings.get(
SYSTEM.id,
SYSTEM.SETTINGS.gameSettings.Automation.ActionPoints
);
if(game.user.isGM){
if(this.system.actions < 1) return;
const update = automateActionPoints ?
{ "system.activeCombatant": combatantId, "system.actions": Math.max(this.system.actions-1, 0) } :
{ "system.activeCombatant": combatantId };
if (game.user.isGM) {
if (this.system.actions < 1) return;
const update = automateActionPoints
? { 'system.activeCombatant': combatantId, 'system.actions': Math.max(this.system.actions - 1, 0) }
: { 'system.activeCombatant': combatantId };
await this.update(update);
} else {
const update = automateActionPoints ?
{ "system.activeCombatant": combatantId, "system.actions": this.system.actions+1} :
{ "system.activeCombatant": combatantId };
const update = automateActionPoints
? { 'system.activeCombatant': combatantId, 'system.actions': this.system.actions + 1 }
: { 'system.activeCombatant': combatantId };
await game.socket.emit(`system.${SYSTEM.id}`, {
action: socketEvent.GMUpdate,
@ -38,4 +41,4 @@ export default class DhpCombat extends Combat {
});
}
}
}
}