feat: Add lootbox item type with weighted rewards and dedicated UI for item usage results.

This commit is contained in:
syntaxbullet
2026-01-05 12:52:34 +01:00
parent 5606fb6e2f
commit 599684cde8
6 changed files with 109 additions and 10 deletions

View File

@@ -19,7 +19,18 @@ export type ItemEffect =
| { type: 'XP_BOOST'; multiplier: number; durationSeconds?: number; durationMinutes?: number; durationHours?: number }
| { type: 'TEMP_ROLE'; roleId: string; durationSeconds?: number; durationMinutes?: number; durationHours?: number }
| { type: 'REPLY_MESSAGE'; message: string }
| { type: 'COLOR_ROLE'; roleId: string };
| { type: 'COLOR_ROLE'; roleId: string }
| { type: 'LOOTBOX'; pool: LootTableItem[] };
export interface LootTableItem {
type: 'CURRENCY' | 'ITEM' | 'XP' | 'NOTHING';
weight: number;
amount?: number; // For CURRENCY, XP
itemId?: number; // For ITEM
minAmount?: number; // Optional range for CURRENCY/XP
maxAmount?: number; // Optional range for CURRENCY/XP
message?: string; // Optional custom message for this outcome
}
export interface ItemUsageData {
consume: boolean;