Skip to content

Furniture/Terrain pages missing required tools for "advanced object deconstruction" #120

@ushkinaz

Description

@ushkinaz

Summary

Furniture and terrain pages show the items obtained by deconstruction but omit the required tools when the deconstruction requires "advanced" techniques (e.g., dismantling a fireplace, capacitor bank, or broken console).

reported at https://discord.com/channels/830879262763909202/830916329053487124/1478949066187477015

Context

  • src/types/Furniture.svelte – Deconstruct section
  • src/types/Terrain.svelte – Deconstruct section
  • src/types.tsConstruction type

Impact

Users cannot find what tools they need to perform advanced deconstruction on specific furniture/terrain (e.g. fireplace, electrical conduit, capacitor). The guide shows the loot but not the tools. This was reported by a player via Discord.

Steps to reproduce

  1. Navigate to the Fireplace (f_fireplace) page in the guide.
  2. Observe the "Deconstruct" section – it lists items dropped, but no tools required.
  3. In-game, deconstructing a fireplace requires HAMMER 2, CHISEL 2, PRY 3, SCREW 1.

Tech details

Root cause – two related gaps:

1. Constructions that deconstruct an item are not surfaced on Furniture/Terrain pages.

Both Furniture.svelte and Terrain.svelte compute a constructions list by filtering for constructions whose post_terrain matches the page's item id (i.e., constructions that build it). They never query for constructions whose pre_terrain or pre_furniture matches the id (i.e., constructions that deconstruct it).

The fix is to add a derived reactive variable in both components:

let deconstructingConstructions = $derived.by(() =>
  data.byType("construction").filter(
    (c) => c.pre_terrain === item.id || c.pre_furniture === item.id
  )
);

Then render these under a new "Deconstruct via" section using the existing <Construction> component, which already handles tool rendering via <RequirementDataTools>.

2. pre_furniture is missing from the Construction type.

The JSON data uses a pre_furniture field on construction objects (distinct from pre_terrain), but the Construction type in src/types.ts only declares pre_terrain. Add:

pre_furniture?: string; // furniture_id

Relevant data structures:

  • Advanced deconstruct constructions use group: "advanced_object_deconstruction" and using: [["object_deconstruction_advanced", 1]].
  • object_deconstruction_advanced is a requirement that resolves to: HAMMER 2, CHISEL 2, PRY 3, SCREW 1.
  • Regular deconstruction (constr_deconstruct, with deny_flags: ["ADV_DECONSTRUCT"]) and easy deconstruction (constr_deconstruct_simple, requiring flag EASY_DECONSTRUCT) are separate constructions that also fire pre_special: "check_deconstruct". Their tools are also not currently shown on Furniture/Terrain pages; this fix would surface them as well.

Examples

  • f_fireplace → deconstructed by constr_remove_object_fireplace
  • f_electrical_conduit → deconstructed by constr_remove_electrical_conduit
  • f_capacitor → deconstructed by constr_remove_capacitor_bank
  • t_console → deconstructed by constr_remove_t_console
  • t_console_broken → deconstructed by constr_remove_t_console_broken

(All from nightly build, _test/all.json)

Acceptance criteria

  • The Fireplace (f_fireplace) detail page shows a section listing the tools required to deconstruct it (HAMMER 2, CHISEL 2, PRY 3, SCREW 1) alongside the existing drop list.
  • The same is true for other furniture/terrain with advanced deconstruction constructions.
  • No regression for pages where no such deconstruction construction exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions