Add tiered leather shoes at the leatherworking station.
Shoes craft from 2 leather per tier via a leather-tier dropdown; leather armour keeps full Agility and half Defence (floored).
@@ -26,6 +26,9 @@ import
26
26
WOOD_TIER_ORDER,
27
27
WoodTier,
28
28
MaterialTier,
29
LEATHER_TIER_ORDER,
30
LEATHER_DISPLAY_NAME,
31
LeatherTier,
29
32
woodTierForMetal,
30
33
clothTierForWood
31
34
} from "/shared/definitions/materialTiers.js";
@@ -70,6 +73,7 @@ export function initCrafting ({
70
73
let selectedRecipeId = null;
71
74
let selectedCraftGroup = null;
72
75
let selectedMaterial = ClothTier.cotton;
76
73
77
let dyeSlotIndex = null;
74
78
let crafting = false;
75
79
let craftTimer = null;
@@ -138,6 +142,11 @@ export function initCrafting ({
138
142
return stationId === CraftingStationId.loom;
139
143
}
140
144
145
function isLeatherworkingStation ()
146
{
147
return stationId === CraftingStationId.leatherworkingStation;
148
}
149
141
150
function usesMaterialDropdown ()
142
151
{
143
152
return isTailorStation()
@@ -145,7 +154,8 @@ export function initCrafting ({
145
154
|| isWoodworkingStation()
146
155
|| isCraftingBenchStation()
147
156
|| isSpinningWheelStation()
148
|| isLoomStation();
157
|| isLoomStation()
158
|| isLeatherworkingStation();
149
159
}
150
160
151
161
/** One grid cell per craft group; material dropdown picks the tier variant. */
@@ -155,7 +165,8 @@ export function initCrafting ({
155
165
|| isWoodworkingStation()
156
166
|| isCraftingBenchStation()
157
167
|| isSpinningWheelStation()
158
|| isLoomStation();
168
|| isLoomStation()
169
|| isLeatherworkingStation();
159
170
}
160
171
161
172
function craftGroupKey (recipe)
@@ -229,6 +240,14 @@ export function initCrafting ({
229
240
fallback: ClothTier.cotton
230
241
};
231
242
}
243
if (isLeatherworkingStation())
244
{
245
return {
246
order: LEATHER_TIER_ORDER,
247
names: LEATHER_DISPLAY_NAME,
248
fallback: LeatherTier.softLeather
249
};
250
}
232
251
if (isWoodworkingStation())
233
252
{
234
253
return {
@@ -26,6 +26,9 @@ import26
WOOD_TIER_ORDER,26
WOOD_TIER_ORDER,27
WoodTier,27
WoodTier,28
MaterialTier,28
MaterialTier,29
LEATHER_TIER_ORDER,30
LEATHER_DISPLAY_NAME,31
LeatherTier,29
woodTierForMetal,32
woodTierForMetal,30
clothTierForWood33
clothTierForWood31
} from "/shared/definitions/materialTiers.js";34
} from "/shared/definitions/materialTiers.js";@@ -70,6 +73,7 @@ export function initCrafting ({70
let selectedRecipeId = null;73
let selectedRecipeId = null;71
let selectedCraftGroup = null;74
let selectedCraftGroup = null;72
let selectedMaterial = ClothTier.cotton;75
let selectedMaterial = ClothTier.cotton;76
73
let dyeSlotIndex = null;77
let dyeSlotIndex = null;74
let crafting = false;78
let crafting = false;75
let craftTimer = null;79
let craftTimer = null;@@ -138,6 +142,11 @@ export function initCrafting ({138
return stationId === CraftingStationId.loom;142
return stationId === CraftingStationId.loom;139
}143
}140
144
145
function isLeatherworkingStation ()146
{147
return stationId === CraftingStationId.leatherworkingStation;148
}149
141
function usesMaterialDropdown ()150
function usesMaterialDropdown ()142
{151
{143
return isTailorStation()152
return isTailorStation()@@ -145,7 +154,8 @@ export function initCrafting ({145
|| isWoodworkingStation()154
|| isWoodworkingStation()146
|| isCraftingBenchStation()155
|| isCraftingBenchStation()147
|| isSpinningWheelStation()156
|| isSpinningWheelStation()148
|| isLoomStation();157
|| isLoomStation()158
|| isLeatherworkingStation();149
}159
}150
160
151
/** One grid cell per craft group; material dropdown picks the tier variant. */161
/** One grid cell per craft group; material dropdown picks the tier variant. */@@ -155,7 +165,8 @@ export function initCrafting ({155
|| isWoodworkingStation()165
|| isWoodworkingStation()156
|| isCraftingBenchStation()166
|| isCraftingBenchStation()157
|| isSpinningWheelStation()167
|| isSpinningWheelStation()158
|| isLoomStation();168
|| isLoomStation()169
|| isLeatherworkingStation();159
}170
}160
171
161
function craftGroupKey (recipe)172
function craftGroupKey (recipe)@@ -229,6 +240,14 @@ export function initCrafting ({229
fallback: ClothTier.cotton240
fallback: ClothTier.cotton230
};241
};231
}242
}243
if (isLeatherworkingStation())244
{245
return {246
order: LEATHER_TIER_ORDER,247
names: LEATHER_DISPLAY_NAME,248
fallback: LeatherTier.softLeather249
};250
}232
if (isWoodworkingStation())251
if (isWoodworkingStation())233
{252
{234
return {253
return {@@ -4,6 +4,7 @@ import { BlockType, blockDefinition } from "../../shared/definitions/tiles.js";
4
4
import { CraftingStationId, CRAFT_DURATION_MS } from "../../shared/definitions/craftingStations.js";
5
5
import { ItemId } from "../../shared/definitions/items.js";
6
6
import { ArmourItemId } from "../../shared/definitions/armourItems.js";
7
import { LeatherItemId } from "../../shared/definitions/leatherItems.js";
7
8
import { SkillId } from "../../shared/definitions/skills.js";
8
9
import
9
10
{
@@ -481,3 +482,26 @@ test("anvil armour recipes use bar counts per piece", () =>
481
482
.filter((recipe) => recipe.recipeId.startsWith("armour-"));
482
483
assert.equal(anvilArmour.length, 7 * 8);
483
484
});
485
486
test("leatherworking shoes recipes use 2 leather per tier", () =>
487
{
488
const shoes = recipesForStation(CraftingStationId.leatherworkingStation)
489
.filter((recipe) => recipe.craftGroup === "leather-shoes");
490
assert.equal(shoes.length, 7);
491
for (const recipe of shoes)
492
{
493
assert.equal(recipe.inputs.length, 1);
494
assert.equal(recipe.inputs[0].quantity, 2);
495
assert.equal(recipe.skillId, "leatherworking");
496
assert.ok(recipe.xpMaterial);
497
assert.equal(recipe.craftGroupLabel, "Shoes");
498
}
499
const soft = recipeDefinition("leather-shoes-softLeather");
500
assert.ok(soft);
501
assert.equal(soft.output.itemId, LeatherItemId.leatherShoes);
502
assert.deepEqual(soft.inputs, [{ itemId: ItemId.leather, quantity: 2 }]);
503
const hide = recipeDefinition("leather-shoes-dragonhide");
504
assert.ok(hide);
505
assert.equal(hide.output.itemId, LeatherItemId.dragonhideShoes);
506
assert.deepEqual(hide.inputs, [{ itemId: LeatherItemId.dragonhide, quantity: 2 }]);
507
});
@@ -4,6 +4,7 @@ import { BlockType, blockDefinition } from "../../shared/definitions/tiles.js";4
import { CraftingStationId, CRAFT_DURATION_MS } from "../../shared/definitions/craftingStations.js";4
import { CraftingStationId, CRAFT_DURATION_MS } from "../../shared/definitions/craftingStations.js";5
import { ItemId } from "../../shared/definitions/items.js";5
import { ItemId } from "../../shared/definitions/items.js";6
import { ArmourItemId } from "../../shared/definitions/armourItems.js";6
import { ArmourItemId } from "../../shared/definitions/armourItems.js";7
import { LeatherItemId } from "../../shared/definitions/leatherItems.js";7
import { SkillId } from "../../shared/definitions/skills.js";8
import { SkillId } from "../../shared/definitions/skills.js";8
import9
import9
{10
{@@ -481,3 +482,26 @@ test("anvil armour recipes use bar counts per piece", () =>481
.filter((recipe) => recipe.recipeId.startsWith("armour-"));482
.filter((recipe) => recipe.recipeId.startsWith("armour-"));482
assert.equal(anvilArmour.length, 7 * 8);483
assert.equal(anvilArmour.length, 7 * 8);483
});484
});485
486
test("leatherworking shoes recipes use 2 leather per tier", () =>487
{488
const shoes = recipesForStation(CraftingStationId.leatherworkingStation)489
.filter((recipe) => recipe.craftGroup === "leather-shoes");490
assert.equal(shoes.length, 7);491
for (const recipe of shoes)492
{493
assert.equal(recipe.inputs.length, 1);494
assert.equal(recipe.inputs[0].quantity, 2);495
assert.equal(recipe.skillId, "leatherworking");496
assert.ok(recipe.xpMaterial);497
assert.equal(recipe.craftGroupLabel, "Shoes");498
}499
const soft = recipeDefinition("leather-shoes-softLeather");500
assert.ok(soft);501
assert.equal(soft.output.itemId, LeatherItemId.leatherShoes);502
assert.deepEqual(soft.inputs, [{ itemId: ItemId.leather, quantity: 2 }]);503
const hide = recipeDefinition("leather-shoes-dragonhide");504
assert.ok(hide);505
assert.equal(hide.output.itemId, LeatherItemId.dragonhideShoes);506
assert.deepEqual(hide.inputs, [{ itemId: LeatherItemId.dragonhide, quantity: 2 }]);507
});@@ -4,7 +4,7 @@ import { ItemId, itemDefinition } from "../../shared/definitions/items.js";
4
4
import { ArmourItemId } from "../../shared/definitions/armourItems.js";
5
5
import { LeatherItemId } from "../../shared/definitions/leatherItems.js";
6
6
import { CraftingItemId } from "../../shared/definitions/craftingItems.js";
7
import { MaterialTier, WoodTier, tierStatBonus, tierMinSkillLevel } from "../../shared/definitions/materialTiers.js";
7
import { MaterialTier, LeatherTier, WoodTier, tierStatBonus, tierMinSkillLevel } from "../../shared/definitions/materialTiers.js";
8
8
import { EquipmentKind } from "../../shared/definitions/equipmentKinds.js";
9
9
import { SkillId } from "../../shared/definitions/skills.js";
10
10
import { normalizePlayerSkills } from "../../shared/skills/state.js";
@@ -114,6 +114,17 @@ test("leather shoes grant independent agility and defence from settings", () =>
114
114
assert.equal(bonuses[SkillId.defence], 1);
115
115
});
116
116
117
test("leather armour defaults to full agility and half metal defence", () =>
118
{
119
const defaults = defaultEquipmentStatBonuses().leatherArmour.shoes;
120
assert.equal(defaults.softLeather.agility, tierStatBonus(LeatherTier.softLeather));
121
assert.equal(defaults.softLeather.defence, Math.floor(tierStatBonus(LeatherTier.softLeather) / 2));
122
assert.equal(defaults.studdedLeather.agility, tierStatBonus(LeatherTier.studdedLeather));
123
assert.equal(defaults.studdedLeather.defence, Math.floor(tierStatBonus(MaterialTier.steel) / 2));
124
assert.equal(defaults.dragonhide.agility, tierStatBonus(LeatherTier.dragonhide));
125
assert.equal(defaults.dragonhide.defence, Math.floor(tierStatBonus(MaterialTier.dragon) / 2));
126
});
127
117
128
test("bronze gear equips at level 1", () =>
118
129
{
119
130
const skills = normalizePlayerSkills(null);
@@ -4,7 +4,7 @@ import { ItemId, itemDefinition } from "../../shared/definitions/items.js";4
import { ArmourItemId } from "../../shared/definitions/armourItems.js";4
import { ArmourItemId } from "../../shared/definitions/armourItems.js";5
import { LeatherItemId } from "../../shared/definitions/leatherItems.js";5
import { LeatherItemId } from "../../shared/definitions/leatherItems.js";6
import { CraftingItemId } from "../../shared/definitions/craftingItems.js";6
import { CraftingItemId } from "../../shared/definitions/craftingItems.js";7
import { MaterialTier, WoodTier, tierStatBonus, tierMinSkillLevel } from "../../shared/definitions/materialTiers.js";7
import { MaterialTier, LeatherTier, WoodTier, tierStatBonus, tierMinSkillLevel } from "../../shared/definitions/materialTiers.js";8
import { EquipmentKind } from "../../shared/definitions/equipmentKinds.js";8
import { EquipmentKind } from "../../shared/definitions/equipmentKinds.js";9
import { SkillId } from "../../shared/definitions/skills.js";9
import { SkillId } from "../../shared/definitions/skills.js";10
import { normalizePlayerSkills } from "../../shared/skills/state.js";10
import { normalizePlayerSkills } from "../../shared/skills/state.js";@@ -114,6 +114,17 @@ test("leather shoes grant independent agility and defence from settings", () =>114
assert.equal(bonuses[SkillId.defence], 1);114
assert.equal(bonuses[SkillId.defence], 1);115
});115
});116
116
117
test("leather armour defaults to full agility and half metal defence", () =>118
{119
const defaults = defaultEquipmentStatBonuses().leatherArmour.shoes;120
assert.equal(defaults.softLeather.agility, tierStatBonus(LeatherTier.softLeather));121
assert.equal(defaults.softLeather.defence, Math.floor(tierStatBonus(LeatherTier.softLeather) / 2));122
assert.equal(defaults.studdedLeather.agility, tierStatBonus(LeatherTier.studdedLeather));123
assert.equal(defaults.studdedLeather.defence, Math.floor(tierStatBonus(MaterialTier.steel) / 2));124
assert.equal(defaults.dragonhide.agility, tierStatBonus(LeatherTier.dragonhide));125
assert.equal(defaults.dragonhide.defence, Math.floor(tierStatBonus(MaterialTier.dragon) / 2));126
});127
117
test("bronze gear equips at level 1", () =>128
test("bronze gear equips at level 1", () =>118
{129
{119
const skills = normalizePlayerSkills(null);130
const skills = normalizePlayerSkills(null);