32 lines
695 B
TypeScript
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;
|
|
}
|