BlueGit

timfa questward

Require oven baking before eggs can be eaten.

Raw eggs are ingredients only; cook-egg is oven-exclusive with cooked and burnt outputs.

timfa Tim Falken · pushed by timfa

Authored 2026-08-31 · 2 months ago

Hash
c10388e115a3cb38d62c2577ef38c424c54af7ec
Parent
2555c4a1
3 files changed +62 −3
server/tests/firestarting-cooking.test.js +18 −1
@@ -13,7 +13,8 @@ import { CraftingItemId, tinderboxItemInstance } from "../../shared/definitions/
13 13 import { WoodItemId, ashItemIdForWood } from "../../shared/definitions/woodItems.js";
14 14 import { WoodTier } from "../../shared/definitions/materialTiers.js";
15 15 import { SkillId } from "../../shared/definitions/skills.js";
16 import { recipeDefinition } from "../../shared/crafting/stationRecipes.js";
16 import { recipeDefinition, recipesForStation } from "../../shared/crafting/stationRecipes.js";
17 import { ItemId, itemDefinition } from "../../shared/definitions/items.js";
17 18 import { emptyEquipment, emptySlots } from "../../shared/items/inventory.js";
18 19 import { totalXpForLevel } from "../../shared/skills/progression.js";
19 20 import { ashTintColor } from "../../shared/render/tint.js";
@@ -113,6 +114,22 @@ test("cook-venison recipe exists for oven and campfire with burnt output", () =>
113 114 assert.equal(recipe.inputs[0].itemId, CraftingItemId.rawMeat);
114 115 });
115 116
117 test("eggs cook only in an oven and cannot be eaten raw", () =>
118 {
119 assert.equal(itemDefinition(ItemId.egg).healing ?? 0, 0);
120 assert.equal(itemDefinition(ItemId.cookedEgg).healing, 3);
121 const recipe = recipeDefinition("cook-egg");
122 assert.ok(recipe);
123 assert.deepEqual(recipe.stationIds, [CraftingStationId.oven]);
124 assert.equal(recipe.output.itemId, ItemId.cookedEgg);
125 assert.equal(recipe.burntOutput.itemId, ItemId.burntEgg);
126 assert.equal(recipe.inputs[0].itemId, ItemId.egg);
127 assert.equal(
128 recipesForStation(CraftingStationId.fireplace).some((r) => r.recipeId === "cook-egg"),
129 false
130 );
131 });
132
116 133 test("fish cook recipes use the species name as craft label", () =>
117 134 {
118 135 const trout = recipeDefinition("cook-trout");
@@ -13,7 +13,8 @@ import { CraftingItemId, tinderboxItemInstance } from "../../shared/definitions/
13import { WoodItemId, ashItemIdForWood } from "../../shared/definitions/woodItems.js";
13import { WoodItemId, ashItemIdForWood } from "../../shared/definitions/woodItems.js";
14import { WoodTier } from "../../shared/definitions/materialTiers.js";
14import { WoodTier } from "../../shared/definitions/materialTiers.js";
15import { SkillId } from "../../shared/definitions/skills.js";
15import { SkillId } from "../../shared/definitions/skills.js";
16import { recipeDefinition } from "../../shared/crafting/stationRecipes.js";
16import { recipeDefinition, recipesForStation } from "../../shared/crafting/stationRecipes.js";
17import { ItemId, itemDefinition } from "../../shared/definitions/items.js";
17import { emptyEquipment, emptySlots } from "../../shared/items/inventory.js";
18import { emptyEquipment, emptySlots } from "../../shared/items/inventory.js";
18import { totalXpForLevel } from "../../shared/skills/progression.js";
19import { totalXpForLevel } from "../../shared/skills/progression.js";
19import { ashTintColor } from "../../shared/render/tint.js";
20import { ashTintColor } from "../../shared/render/tint.js";
@@ -113,6 +114,22 @@ test("cook-venison recipe exists for oven and campfire with burnt output", () =>
113 assert.equal(recipe.inputs[0].itemId, CraftingItemId.rawMeat);
114 assert.equal(recipe.inputs[0].itemId, CraftingItemId.rawMeat);
114});
115});
115
116
117test("eggs cook only in an oven and cannot be eaten raw", () =>
118{
119 assert.equal(itemDefinition(ItemId.egg).healing ?? 0, 0);
120 assert.equal(itemDefinition(ItemId.cookedEgg).healing, 3);
121 const recipe = recipeDefinition("cook-egg");
122 assert.ok(recipe);
123 assert.deepEqual(recipe.stationIds, [CraftingStationId.oven]);
124 assert.equal(recipe.output.itemId, ItemId.cookedEgg);
125 assert.equal(recipe.burntOutput.itemId, ItemId.burntEgg);
126 assert.equal(recipe.inputs[0].itemId, ItemId.egg);
127 assert.equal(
128 recipesForStation(CraftingStationId.fireplace).some((r) => r.recipeId === "cook-egg"),
129 false
130 );
131});
132
116test("fish cook recipes use the species name as craft label", () =>
133test("fish cook recipes use the species name as craft label", () =>
117{
134{
118 const trout = recipeDefinition("cook-trout");
135 const trout = recipeDefinition("cook-trout");
shared/crafting/stationRecipes.js +12 −0
@@ -200,6 +200,18 @@ export const CRAFT_RECIPES = Object.freeze([
200 200 burntOutput: { itemId: CraftingItemId.burntMeat, quantity: 1 }
201 201 }),
202 202
203 Object.freeze({
204 recipeId: "cook-egg",
205 stationIds: [CraftingStationId.oven],
206 craftGroup: "cook-egg",
207 craftGroupLabel: "Egg",
208 output: { itemId: ItemId.cookedEgg, quantity: 1 },
209 inputs: [{ itemId: ItemId.egg, quantity: 1 }],
210 minSkillLevel: 1,
211 skillId: "cooking",
212 burntOutput: { itemId: ItemId.burntEgg, quantity: 1 }
213 }),
214
203 215 ...fishingToolRecipes(),
204 216 ...fishingCookRecipes(),
205 217 ...gemCutRecipes(),
@@ -200,6 +200,18 @@ export const CRAFT_RECIPES = Object.freeze([
200 burntOutput: { itemId: CraftingItemId.burntMeat, quantity: 1 }
200 burntOutput: { itemId: CraftingItemId.burntMeat, quantity: 1 }
201 }),
201 }),
202
202
203 Object.freeze({
204 recipeId: "cook-egg",
205 stationIds: [CraftingStationId.oven],
206 craftGroup: "cook-egg",
207 craftGroupLabel: "Egg",
208 output: { itemId: ItemId.cookedEgg, quantity: 1 },
209 inputs: [{ itemId: ItemId.egg, quantity: 1 }],
210 minSkillLevel: 1,
211 skillId: "cooking",
212 burntOutput: { itemId: ItemId.burntEgg, quantity: 1 }
213 }),
214
203 ...fishingToolRecipes(),
215 ...fishingToolRecipes(),
204 ...fishingCookRecipes(),
216 ...fishingCookRecipes(),
205 ...gemCutRecipes(),
217 ...gemCutRecipes(),
shared/definitions/items.js +32 −2
@@ -40,6 +40,8 @@ export const ItemId = Object.freeze({
40 40 potion: 32,
41 41 recipePaper: 33,
42 42 egg: 275,
43 cookedEgg: 504,
44 burntEgg: 505,
43 45 ...SpellbookItemId,
44 46 ...MetalItemId,
45 47 ...WoodItemId,
@@ -129,13 +131,41 @@ export const ITEM_DEFINITIONS = Object.freeze({
129 131 itemId: ItemId.egg,
130 132 key: "egg",
131 133 displayName: "Egg",
132 description: "A fresh egg, still warm from the nest.",
134 description: "A fresh egg, still warm from the nest. Bake it in an oven before eating.",
135 seedValue: 1,
136 stackable: true,
137 maxStackSize: DEFAULT_MAX_STACK,
138 uniqueInstance: false,
139 category: "ingredient",
140 iconKey: "egg",
141 defaultState: "egg"
142 }),
143 [ItemId.cookedEgg]: Object.freeze({
144 itemId: ItemId.cookedEgg,
145 key: "cooked-egg",
146 displayName: "Cooked egg",
147 description: "An egg baked until firm, ready to eat.",
148 seedValue: 2,
149 stackable: true,
150 maxStackSize: DEFAULT_MAX_STACK,
151 uniqueInstance: false,
152 category: "food",
153 iconKey: "egg",
154 defaultState: "egg",
155 healing: 3
156 }),
157 [ItemId.burntEgg]: Object.freeze({
158 itemId: ItemId.burntEgg,
159 key: "burnt-egg",
160 displayName: "Burnt egg",
161 description: "An egg left too long in the oven — dry and inedible.",
133 162 seedValue: 1,
134 163 stackable: true,
135 164 maxStackSize: DEFAULT_MAX_STACK,
136 165 uniqueInstance: false,
137 166 category: "food",
138 healing: 2
167 iconKey: "egg",
168 defaultState: "egg"
139 169 }),
140 170 [ItemId.stick]: Object.freeze({
141 171 itemId: ItemId.stick,
@@ -40,6 +40,8 @@ export const ItemId = Object.freeze({
40 potion: 32,
40 potion: 32,
41 recipePaper: 33,
41 recipePaper: 33,
42 egg: 275,
42 egg: 275,
43 cookedEgg: 504,
44 burntEgg: 505,
43 ...SpellbookItemId,
45 ...SpellbookItemId,
44 ...MetalItemId,
46 ...MetalItemId,
45 ...WoodItemId,
47 ...WoodItemId,
@@ -129,13 +131,41 @@ export const ITEM_DEFINITIONS = Object.freeze({
129 itemId: ItemId.egg,
131 itemId: ItemId.egg,
130 key: "egg",
132 key: "egg",
131 displayName: "Egg",
133 displayName: "Egg",
132 description: "A fresh egg, still warm from the nest.",
134 description: "A fresh egg, still warm from the nest. Bake it in an oven before eating.",
135 seedValue: 1,
136 stackable: true,
137 maxStackSize: DEFAULT_MAX_STACK,
138 uniqueInstance: false,
139 category: "ingredient",
140 iconKey: "egg",
141 defaultState: "egg"
142 }),
143 [ItemId.cookedEgg]: Object.freeze({
144 itemId: ItemId.cookedEgg,
145 key: "cooked-egg",
146 displayName: "Cooked egg",
147 description: "An egg baked until firm, ready to eat.",
148 seedValue: 2,
149 stackable: true,
150 maxStackSize: DEFAULT_MAX_STACK,
151 uniqueInstance: false,
152 category: "food",
153 iconKey: "egg",
154 defaultState: "egg",
155 healing: 3
156 }),
157 [ItemId.burntEgg]: Object.freeze({
158 itemId: ItemId.burntEgg,
159 key: "burnt-egg",
160 displayName: "Burnt egg",
161 description: "An egg left too long in the oven — dry and inedible.",
133 seedValue: 1,
162 seedValue: 1,
134 stackable: true,
163 stackable: true,
135 maxStackSize: DEFAULT_MAX_STACK,
164 maxStackSize: DEFAULT_MAX_STACK,
136 uniqueInstance: false,
165 uniqueInstance: false,
137 category: "food",
166 category: "food",
138 healing: 2
167 iconKey: "egg",
168 defaultState: "egg"
139 }),
169 }),
140 [ItemId.stick]: Object.freeze({
170 [ItemId.stick]: Object.freeze({
141 itemId: ItemId.stick,
171 itemId: ItemId.stick,