diff --git a/src/commands/collection.ts b/src/commands/collection.ts index 982c4ad..dac6423 100644 --- a/src/commands/collection.ts +++ b/src/commands/collection.ts @@ -81,7 +81,10 @@ export class CollectionCommand extends Command { wishlist = ` · ◆${card.mapper.wishlistEntries.length} `; } - return `\`${card.id}\` · ${conditionEmoji} ${wishlist}· ${card.mapper.username} (${card.burnValue} gold)`; + let attributes = [...card.getAttributes()].map(it => `\`${it}\``).join(' · ') + attributes = attributes ? ' · ' + attributes : '' + + return `\`${card.id}\` · ${conditionEmoji} ${wishlist}· ${card.mapper.username} (${card.burnValue} gold)${attributes}`; }) .join('\n') + `\n\nSorting by: \`${orderByReadable}\`` ); diff --git a/src/commands/drop.ts b/src/commands/drop.ts index eb8dd02..ed6a6b7 100644 --- a/src/commands/drop.ts +++ b/src/commands/drop.ts @@ -115,7 +115,7 @@ export class DropCommand extends Command { const buttons = cards.map((card) => { let name = card.mapper.username; - if (card.attributes.length > 0) { + if (card.foil) { name += ' (Foil)'; } diff --git a/src/commands/use.ts b/src/commands/use.ts index b288e00..5ba53e2 100644 --- a/src/commands/use.ts +++ b/src/commands/use.ts @@ -161,7 +161,7 @@ export class UseCommand extends Command { const buttons = cards.map((card) => { let name = card.mapper.username; - if (card.attributes.length > 0) { + if (card.foil) { name += ' (Foil)'; } diff --git a/src/entities/card.ts b/src/entities/card.ts index 9c4f34f..3914c15 100644 --- a/src/entities/card.ts +++ b/src/entities/card.ts @@ -86,13 +86,12 @@ export class Card { }[this.condition.id]!; } - get attributes() { - const attributes: string[] = []; - - if (this.foil) attributes.push('Foil'); - - return attributes; - } + * getAttributes(): Generator { + if (this.foil) + yield 'foil' + if (this.jobMindblocked) + yield 'mindblocked' + } get jobEffort() { return Math.round(