metal armour
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
@@ -67,6 +67,17 @@ function itemScanDefs ()
animationSpeed: def.animationSpeed ?? 0
};
}
/** Shared metal armour worn overlays (items/armour/*-equip.png). */
if (!defs.armour)
{
defs.armour = {
key: "armour",
id: "armour-overlays",
frames: 1,
framesPerRow: 1,
animationSpeed: 0
};
}
return defs;
}
@@ -67,6 +67,17 @@ function itemScanDefs () animationSpeed: def.animationSpeed ?? 0 animationSpeed: def.animationSpeed ?? 0 }; }; } } /** Shared metal armour worn overlays (items/armour/*-equip.png). */ if (!defs.armour) { defs.armour = { key: "armour", id: "armour-overlays", frames: 1, framesPerRow: 1, animationSpeed: 0 }; } return defs; return defs;}}@@ -3,6 +3,7 @@ import assert from "node:assert/strict";
import { BlockType, blockDefinition } from "../../shared/definitions/tiles.js";
import { CraftingStationId, CRAFT_DURATION_MS } from "../../shared/definitions/craftingStations.js";
import { ItemId } from "../../shared/definitions/items.js";
import { ArmourItemId } from "../../shared/definitions/armourItems.js";
import { SkillId } from "../../shared/definitions/skills.js";
import {
MaterialTier,
@@ -395,3 +396,34 @@ test("bronze pickaxe chain: pine log → handle, bar → head, assemble pickaxe"
finally
{ harness.close(); }
});
test("anvil armour recipes use bar counts per piece", () =>
{
const chest = recipeDefinition("armour-chestplate-bronze");
assert.ok(chest);
assert.equal(chest.stationId, CraftingStationId.anvil);
assert.equal(chest.output.itemId, ArmourItemId.bronzeChestplate);
assert.deepEqual(chest.inputs, [{ itemId: ItemId.bronzeBar, quantity: 6 }]);
const greaves = recipeDefinition("armour-greaves-iron");
assert.deepEqual(greaves.inputs, [{ itemId: ItemId.ironBar, quantity: 4 }]);
const boots = recipeDefinition("armour-boots-steel");
assert.deepEqual(boots.inputs, [{ itemId: ItemId.steelBar, quantity: 2 }]);
const helmet = recipeDefinition("armour-helmet-mithril");
assert.deepEqual(helmet.inputs, [{ itemId: ItemId.mithrilBar, quantity: 2 }]);
const fullHelm = recipeDefinition("armour-full-helm-adamantium");
assert.deepEqual(fullHelm.inputs, [{ itemId: ItemId.adamantiumBar, quantity: 3 }]);
const horned = recipeDefinition("armour-horned-helm-orichalcum");
assert.deepEqual(horned.inputs, [
{ itemId: ItemId.orichalcumBar, quantity: 2 },
{ itemId: ItemId.bones, quantity: 1 }
]);
const anvilArmour = recipesForStation(CraftingStationId.anvil)
.filter((recipe) => recipe.recipeId.startsWith("armour-"));
assert.equal(anvilArmour.length, 7 * 6);
});
@@ -3,6 +3,7 @@ import assert from "node:assert/strict";import { BlockType, blockDefinition } from "../../shared/definitions/tiles.js";import { BlockType, blockDefinition } from "../../shared/definitions/tiles.js";import { CraftingStationId, CRAFT_DURATION_MS } from "../../shared/definitions/craftingStations.js";import { CraftingStationId, CRAFT_DURATION_MS } from "../../shared/definitions/craftingStations.js";import { ItemId } from "../../shared/definitions/items.js";import { ItemId } from "../../shared/definitions/items.js";import { ArmourItemId } from "../../shared/definitions/armourItems.js";import { SkillId } from "../../shared/definitions/skills.js";import { SkillId } from "../../shared/definitions/skills.js";import {import { MaterialTier, MaterialTier,@@ -395,3 +396,34 @@ test("bronze pickaxe chain: pine log → handle, bar → head, assemble pickaxe" finally finally { harness.close(); } { harness.close(); }});});test("anvil armour recipes use bar counts per piece", () =>{ const chest = recipeDefinition("armour-chestplate-bronze"); assert.ok(chest); assert.equal(chest.stationId, CraftingStationId.anvil); assert.equal(chest.output.itemId, ArmourItemId.bronzeChestplate); assert.deepEqual(chest.inputs, [{ itemId: ItemId.bronzeBar, quantity: 6 }]); const greaves = recipeDefinition("armour-greaves-iron"); assert.deepEqual(greaves.inputs, [{ itemId: ItemId.ironBar, quantity: 4 }]); const boots = recipeDefinition("armour-boots-steel"); assert.deepEqual(boots.inputs, [{ itemId: ItemId.steelBar, quantity: 2 }]); const helmet = recipeDefinition("armour-helmet-mithril"); assert.deepEqual(helmet.inputs, [{ itemId: ItemId.mithrilBar, quantity: 2 }]); const fullHelm = recipeDefinition("armour-full-helm-adamantium"); assert.deepEqual(fullHelm.inputs, [{ itemId: ItemId.adamantiumBar, quantity: 3 }]); const horned = recipeDefinition("armour-horned-helm-orichalcum"); assert.deepEqual(horned.inputs, [ { itemId: ItemId.orichalcumBar, quantity: 2 }, { itemId: ItemId.bones, quantity: 1 } ]); const anvilArmour = recipesForStation(CraftingStationId.anvil) .filter((recipe) => recipe.recipeId.startsWith("armour-")); assert.equal(anvilArmour.length, 7 * 6);});@@ -1,10 +1,12 @@
import test from "node:test";
import assert from "node:assert/strict";
import { ItemId, itemDefinition } from "../../shared/definitions/items.js";
import { MaterialTier, tierStatBonus } from "../../shared/definitions/materialTiers.js";
import { ArmourItemId } from "../../shared/definitions/armourItems.js";
import { MaterialTier, tierStatBonus, tierMinSkillLevel } from "../../shared/definitions/materialTiers.js";
import { EquipmentKind } from "../../shared/definitions/equipmentKinds.js";
import { SkillId } from "../../shared/definitions/skills.js";
import { normalizePlayerSkills } from "../../shared/skills/state.js";
import { totalXpForLevel } from "../../shared/skills/progression.js";
import {
canEquipItem,
effectiveSkillLevel,
@@ -58,3 +60,37 @@ test("higher tiers require the relevant skill level", () =>
skills.xp[SkillId.swordfighting] = 999999;
assert.equal(canEquipItem(skills, ironSword).ok, true);
});
test("full helm grants +1 defence bonus and +1 equip level", () =>
{
const helmet = itemDefinition(ArmourItemId.bronzeHelmet);
const fullHelm = itemDefinition(ArmourItemId.bronzeFullHelm);
const horned = itemDefinition(ArmourItemId.bronzeHornedHelm);
const skills = normalizePlayerSkills(null);
assert.equal(helmet.equipment.bonus, undefined);
assert.equal(fullHelm.equipment.bonus, tierStatBonus(MaterialTier.bronze) + 1);
assert.equal(horned.equipment.bonus, undefined);
assert.equal(canEquipItem(skills, helmet).ok, true);
assert.equal(canEquipItem(skills, fullHelm).ok, false);
skills.xp[SkillId.defence] = totalXpForLevel(tierMinSkillLevel(MaterialTier.bronze) + 1);
assert.equal(canEquipItem(skills, fullHelm).ok, true);
const slots = {
...emptyEquipment().slots,
head: { itemId: ArmourItemId.bronzeFullHelm, quantity: 1 }
};
assert.equal(
equipmentBonusesFromSlots(slots)[SkillId.defence],
tierStatBonus(MaterialTier.bronze) + 1
);
const hornedSlots = {
...emptyEquipment().slots,
head: { itemId: ArmourItemId.bronzeHornedHelm, quantity: 1 }
};
assert.equal(
equipmentBonusesFromSlots(hornedSlots)[SkillId.defence],
tierStatBonus(MaterialTier.bronze)
);
});
@@ -1,10 +1,12 @@import test from "node:test";import test from "node:test";import assert from "node:assert/strict";import assert from "node:assert/strict";import { ItemId, itemDefinition } from "../../shared/definitions/items.js";import { ItemId, itemDefinition } from "../../shared/definitions/items.js";import { MaterialTier, tierStatBonus } from "../../shared/definitions/materialTiers.js";import { ArmourItemId } from "../../shared/definitions/armourItems.js";import { MaterialTier, tierStatBonus, tierMinSkillLevel } from "../../shared/definitions/materialTiers.js";import { EquipmentKind } from "../../shared/definitions/equipmentKinds.js";import { EquipmentKind } from "../../shared/definitions/equipmentKinds.js";import { SkillId } from "../../shared/definitions/skills.js";import { SkillId } from "../../shared/definitions/skills.js";import { normalizePlayerSkills } from "../../shared/skills/state.js";import { normalizePlayerSkills } from "../../shared/skills/state.js";import { totalXpForLevel } from "../../shared/skills/progression.js";import {import { canEquipItem, canEquipItem, effectiveSkillLevel, effectiveSkillLevel,@@ -58,3 +60,37 @@ test("higher tiers require the relevant skill level", () => skills.xp[SkillId.swordfighting] = 999999; skills.xp[SkillId.swordfighting] = 999999; assert.equal(canEquipItem(skills, ironSword).ok, true); assert.equal(canEquipItem(skills, ironSword).ok, true);});});test("full helm grants +1 defence bonus and +1 equip level", () =>{ const helmet = itemDefinition(ArmourItemId.bronzeHelmet); const fullHelm = itemDefinition(ArmourItemId.bronzeFullHelm); const horned = itemDefinition(ArmourItemId.bronzeHornedHelm); const skills = normalizePlayerSkills(null); assert.equal(helmet.equipment.bonus, undefined); assert.equal(fullHelm.equipment.bonus, tierStatBonus(MaterialTier.bronze) + 1); assert.equal(horned.equipment.bonus, undefined); assert.equal(canEquipItem(skills, helmet).ok, true); assert.equal(canEquipItem(skills, fullHelm).ok, false); skills.xp[SkillId.defence] = totalXpForLevel(tierMinSkillLevel(MaterialTier.bronze) + 1); assert.equal(canEquipItem(skills, fullHelm).ok, true); const slots = { ...emptyEquipment().slots, head: { itemId: ArmourItemId.bronzeFullHelm, quantity: 1 } }; assert.equal( equipmentBonusesFromSlots(slots)[SkillId.defence], tierStatBonus(MaterialTier.bronze) + 1 ); const hornedSlots = { ...emptyEquipment().slots, head: { itemId: ArmourItemId.bronzeHornedHelm, quantity: 1 } }; assert.equal( equipmentBonusesFromSlots(hornedSlots)[SkillId.defence], tierStatBonus(MaterialTier.bronze) );});