@dreadwood-types/types 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cooking.d.ts +8 -0
- package/dist/cooking.d.ts.map +1 -1
- package/dist/cooking.js +19 -6
- package/dist/cooking.js.map +1 -1
- package/package.json +1 -1
package/dist/cooking.d.ts
CHANGED
|
@@ -4,6 +4,14 @@ export type CookingRecipe = {
|
|
|
4
4
|
level: number;
|
|
5
5
|
xp: number;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* Cooking XP is derived from the recipe's level, not hand-set. The old flat
|
|
9
|
+
* 30-70 per cook levelled the skill absurdly fast (two cooked crabs = level 2).
|
|
10
|
+
* `level * 5` keeps it in step with combat's `enemy level * 6` and scales
|
|
11
|
+
* sensibly into the higher recipes.
|
|
12
|
+
*/
|
|
13
|
+
export declare const COOKING_XP_PER_LEVEL = 5;
|
|
14
|
+
export declare function cookingXpForLevel(level: number): number;
|
|
7
15
|
export declare const COOKING_RECIPES: readonly CookingRecipe[];
|
|
8
16
|
export declare function cookingRecipeForInput(input: string): CookingRecipe | null;
|
|
9
17
|
export declare const COOK_INTERVAL_MS = 1000;
|
package/dist/cooking.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cooking.d.ts","sourceRoot":"","sources":["../src/cooking.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAAS,aAAa,EAOnD,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAEzE;AAED,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAa9C,CAAC;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAEzD"}
|
|
1
|
+
{"version":3,"file":"cooking.d.ts","sourceRoot":"","sources":["../src/cooking.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvD;AAMD,eAAO,MAAM,eAAe,EAAE,SAAS,aAAa,EAOnD,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAEzE;AAED,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAa9C,CAAC;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAEzD"}
|
package/dist/cooking.js
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cooking XP is derived from the recipe's level, not hand-set. The old flat
|
|
3
|
+
* 30-70 per cook levelled the skill absurdly fast (two cooked crabs = level 2).
|
|
4
|
+
* `level * 5` keeps it in step with combat's `enemy level * 6` and scales
|
|
5
|
+
* sensibly into the higher recipes.
|
|
6
|
+
*/
|
|
7
|
+
export const COOKING_XP_PER_LEVEL = 5;
|
|
8
|
+
export function cookingXpForLevel(level) {
|
|
9
|
+
return Math.max(COOKING_XP_PER_LEVEL, Math.round(level * COOKING_XP_PER_LEVEL));
|
|
10
|
+
}
|
|
11
|
+
function cookingRecipe(input, output, level) {
|
|
12
|
+
return { input, output, level, xp: cookingXpForLevel(level) };
|
|
13
|
+
}
|
|
1
14
|
export const COOKING_RECIPES = [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
15
|
+
cookingRecipe('crabmeat', 'cookedcrab', 1),
|
|
16
|
+
cookingRecipe('rawbass', 'cookedbass', 1),
|
|
17
|
+
cookingRecipe('frog', 'cookedfroglegs', 1),
|
|
18
|
+
cookingRecipe('rawrabbit', 'cookedrabbit', 5),
|
|
19
|
+
cookingRecipe('rawtench', 'cookedtench', 20),
|
|
20
|
+
cookingRecipe('rawperch', 'cookedperch', 7),
|
|
8
21
|
];
|
|
9
22
|
export function cookingRecipeForInput(input) {
|
|
10
23
|
return COOKING_RECIPES.find((r) => r.input === input) ?? null;
|
package/dist/cooking.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cooking.js","sourceRoot":"","sources":["../src/cooking.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"cooking.js","sourceRoot":"","sources":["../src/cooking.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAEtC,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,OAAO,IAAI,CAAC,GAAG,CAAC,oBAAoB,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,oBAAoB,CAAC,CA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