Files
firstProj/src/controllers/Resources/PropDropTable.ts
T
Vasyl Kazakov 6363396f84 day 5
2026-05-29 18:01:05 +03:00

32 lines
695 B
TypeScript

import { PropType } from "../Map/PropType";
import { ResourceType } from "./ResourceType";
export type DropRule = {
resource: ResourceType;
minTotal: number;
maxTotal: number;
minSpawnHits: number;
maxSpawnHits: number;
};
export const PROP_DROPS: Record<PropType, DropRule[]> = {
[PropType.Box]: [
{
resource: ResourceType.Wood,
minTotal: 1,
maxTotal: 3,
minSpawnHits: 1,
maxSpawnHits: 2,
},
],
};
export function resolvePropType(objectName: string): PropType {
const name = objectName.toLowerCase();
if (name.includes("box") || name.includes("crate") || name.includes("wood")) {
return PropType.Box;
}
return PropType.Box;
}