Resources & Recipes

Animal Products

Access every item dropped or produced by an animal in Dinkum, with the biomes each source animal is found in.


Type

interface AnimalProduct {
  id: string
  name: string
  img: string
  source?: string[]
  baseSellPrice: number
  buyPrice?: number
  buffs?: Buffs
  locations?: Biome[]
}
FieldTypeDescription
idstringStable identifier.
namestringDisplay name.
imgstringPath to the item's icon, relative to images/.
sourcestring[]?The animal(s) that produce this item.
baseSellPricenumberBase sell price in Dinks.
buyPricenumber?Purchase price, if purchasable.
buffsBuffs?Consumable buff effects, if edible.
locationsBiome[]?Biomes where the source animal is found.

See TypeScript integration for the shared Buffs and Biome shapes.


Factory

import { animalProducts } from 'dinkum-data'

animalProducts() // all 36 items
animalProducts(source) // wrap a pre-filtered array

Filters

byLocation(biome: Biome)

Filter to products found in the given biome. Products with no locations never match.

animalProducts().byLocation('Bushlands').get()

Terminal methods

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

Examples

import { animalProducts } from 'dinkum-data'

// Every animal product found in Bushlands
animalProducts().byLocation('Bushlands').get()

// Look up by name
animalProducts().findByName('Alpha Antler')

Next steps

Previous
Flowers