Resources & Recipes

Other Craftables

Access every miscellaneous craftable resource in Dinkum that doesn't fit the recipe modules, like processed goods from the Crusher, Stone Grinder, and Grain Mill.


Type

This module uses the same shared Recipe type as Crafting Recipes.

interface Recipe {
  id: string
  name: string
  img: string
  source?: string[]
  baseSellPrice: number
  buyPrice?: number
  outputCount?: number | 'Varies'
  variants: ResourceVariant[]
  buffs?: Buffs
}
FieldTypeDescription
idstringStable identifier.
namestringDisplay name.
imgstringPath to the item's icon, relative to images/.
sourcestring[]?The machine or process that produces it.
baseSellPricenumberBase sell price in Dinks.
buyPricenumber?Purchase price, if purchasable.
outputCountnumber | 'Varies'?Quantity produced per craft.
variantsResourceVariant[]Ingredient sets that produce this item.
buffsBuffs?Consumable buff effects, if any.

See TypeScript integration for the shared ResourceVariant/Resource/Buffs shapes.


Factory

import { otherCraftables } from 'dinkum-data'

otherCraftables() // all 32 items
otherCraftables(source) // wrap a pre-filtered array

Filters

bySource(source: string)

Filter to craftables obtainable from the given source (case-insensitive substring match). Items with no source never match.

otherCraftables().bySource('Crusher').get()

Terminal methods

MethodReturnsDescription
.get()Recipe[]All results
.first()Recipe | undefinedFirst result
.find(id)Recipe | undefinedFind by id
.findByName(name)Recipe | undefinedCase-insensitive exact name match
.search(query)Recipe[]Case-insensitive partial name match
.count()numberNumber of results

Examples

import { otherCraftables } from 'dinkum-data'

// Everything produced by the Crusher
otherCraftables().bySource('Crusher').get()

Next steps

Previous
Trophies