day 5
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user