Skip to content

Commit

Permalink
Display effects
Browse files Browse the repository at this point in the history
  • Loading branch information
holzmaster committed Sep 9, 2024
1 parent b7e01ee commit 42da55d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/commands/gegenstand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,19 @@ export default class GegenstandCommand implements ApplicationCommand {
return;
}

const effects = lootService.getEffects(item);

await interaction.reply({
embeds: [
{
title: item.displayName,
description: item.description,
color: 0x00ff00,
fields: effects.map(value => ({
name: "🌟 Effekt",
value,
inline: true,
})),
},
],
});
Expand Down
5 changes: 5 additions & 0 deletions src/service/loot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,11 @@ export function deleteLoot(lootId: LootId) {
return loot.deleteLoot(lootId);
}

export function getEffects(item: Loot) {
const template = resolveLootTemplate(item.lootKindId);
return template?.effects ?? [];
}

export function replaceLoot(
lootId: LootId,
replacement: LootInsertable,
Expand Down

0 comments on commit 42da55d

Please sign in to comment.