minor fixes, add superloot cheer

This commit is contained in:
2025-10-11 18:59:02 +02:00
parent e46cec80ed
commit c9fb09e36c
15 changed files with 119 additions and 37 deletions

View File

@@ -41,7 +41,7 @@ export class Item {
};
import { readdir } from 'node:fs/promises';
import { updateUserRecord, type inventoryUpdate } from "db/dbUser";
import { updateUserRecord, type UserRecord } from "db/dbUser";
const itemAliasMap = new Map<string, Item>;
const itemObjectArray: Item[] = []
const specialAliasItems = new Map<string, Item>;
@@ -72,7 +72,7 @@ export type inventory = {
[key in items]?: number;
};
export async function changeItemCount(user: User, userRecord: inventoryUpdate, itemname: items, amount = -1): Promise<false | inventoryUpdate> {
export async function changeItemCount(user: User, userRecord: UserRecord, itemname: items, amount = -1): Promise<false | UserRecord> {
userRecord.inventory[itemname] = userRecord.inventory[itemname]! += amount;
if (userRecord.inventory[itemname] < 0) return false;
await updateUserRecord(user, userRecord);