Skip to content

Tools, weapons & armour (tiered tool system) #11

Description

@MichaelFisher1997

Depends on #1 (crafting) for shaped recipes, #2 (ores) for tier materials, and #3 (smelting) to turn ores into usable ingots. Build last of the four interlocking survival systems.

Context

src/game/Items.ts:7-8 explicitly defers tools: the comment notes "Item ids are strings so the registry can grow to tools/materials later" — but ItemDef.icon (line 27) currently only supports "block" | "food". There are no pickaxe/axe/shovel/sword/hoe items and no tool-tier mining logic.

Scope

  • src/game/Items.ts — extend ItemDef to support tools:
    • category: "tool" | "weapon" | "armour" added to the icon/union
    • tier: "wood" | "stone" | "copper" | "iron" | "gold" | "diamond"
    • toolType: "pickaxe" | "axe" | "shovel" | "sword" | "hoe"
    • durability: number, miningSpeed: number, damage: number
    • Mining-tier requirements per block (e.g. diamond ore needs iron-tier+)
  • Tool textures — either a new item atlas or reuse the block atlas tiles (coordinate with Textures.ts; atlas has spare tiles).
  • src/game/Recipes.ts (from Voxel lighting + day/night cycle (sun, moon, two-channel shading) #1) — shaped recipes for each tool across all tiers (pickaxe = 3 head + 2 sticks, etc.).
  • Mining speed + durability — wire into the mining code path (in Game.ts around the right-click/mining handler ~Game.ts:723, and PlayerState.ts). Each block mined decrements durability; speed scales by tier vs. block hardness.
  • Weapons — sword damage + knockback + i-frames in the combat path (combat itself is Phase 3, but the item/damage plumbing lands here).
  • Armour — helmet/chestplate/leggings/boots slots in inventory; damage-soak hook in PlayerState.ts damage handling.
  • src/ui/InventoryUI.ts + ui.css — durability bar overlay on hotbar/inventory slots; armour slot panel.

Acceptance criteria

Roadmap reference

Phase 2 — "Tools, weapons & armour".

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestphase-2Phase 2 — Crafting & survival depth (active)

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions