✨Feature: implement loot resolution system with gold and item tracking from defeated creatures
This commit is contained in:
20
src/App.tsx
20
src/App.tsx
@@ -173,7 +173,25 @@ function App() {
|
||||
.
|
||||
</p>
|
||||
<p className="supporting-text">
|
||||
Run rewards: {run.xpGained} XP earned, {run.defeatedCreatureIds.length} foes defeated.
|
||||
Run rewards: {run.xpGained} XP, {run.goldGained} gold,{" "}
|
||||
{run.defeatedCreatureIds.length} foes defeated.
|
||||
</p>
|
||||
<p className="supporting-text">
|
||||
Carried gold: {run.adventurerSnapshot.inventory.currency.gold}. Looted items:{" "}
|
||||
{run.lootedItems.length === 0
|
||||
? "none yet"
|
||||
: run.lootedItems
|
||||
.map((entry) => {
|
||||
const item = sampleContentPack.items.find(
|
||||
(candidate) => candidate.id === entry.definitionId,
|
||||
);
|
||||
|
||||
return entry.quantity > 1
|
||||
? `${entry.quantity}x ${item?.name ?? entry.definitionId}`
|
||||
: item?.name ?? entry.definitionId;
|
||||
})
|
||||
.join(", ")}
|
||||
.
|
||||
</p>
|
||||
</article>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user