Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MangoFVTT committed Nov 16, 2024
1 parent 9074dc8 commit ded5def
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/system/documents/actor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,6 @@ export class CosmereActor<
data: data as D20RollData,
title: flavor,
defaultAttribute: options.attribute ?? skill.attribute,
parts: [`@mod`].concat(options.parts ?? []),
messageData: {
speaker:
options.speaker ??
Expand All @@ -706,6 +705,7 @@ export class CosmereActor<
options,
);

rollData.parts = [`@mod`].concat(options.parts ?? []);
rollData.messageData.flags[SYSTEM_ID] = {
message: {
type: MESSAGE_TYPES.SKILL,
Expand Down
14 changes: 6 additions & 8 deletions src/system/documents/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1059,19 +1059,15 @@ export class CosmereItem<
const traitsNormal = [];
const traitsExpert = [];
const traits = [];
if (this.system.traits) {
for (const [key, value] of Object.entries(
this.system.traits as TraitsItemData,
)) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
if (this.hasTraits()) {
for (const [key, value] of Object.entries(this.system.traits)) {
if (!value?.active) continue;

const traitLoc =
CONFIG.COSMERE.traits.weaponTraits[key as WeaponTraitId] ??
CONFIG.COSMERE.traits.armorTraits[key as ArmorTraitId];
let label = game.i18n!.localize(traitLoc.label);

// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
if (value.expertise?.toggleActive) {
label = `<strong>${label}</strong>`;
traitsExpert.push(label);
Expand All @@ -1084,8 +1080,10 @@ export class CosmereItem<
}

let action;
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
if (this.system.activation?.cost?.value !== undefined) {
if (
this.hasActivation() &&
this.system.activation?.cost?.value !== undefined
) {
const activation = this.system.activation as Record<
string,
unknown
Expand Down
1 change: 1 addition & 0 deletions src/system/types/cosmere.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,5 +285,6 @@ export const enum TurnSpeed {

export const enum Theme {
Default = 'default',
//TODO: Move to stormlight module
Stormlight = 'stormlight',
}

0 comments on commit ded5def

Please sign in to comment.