Antiques

Estimated reading time: 2 minutes

Antique registration adds new museum antique text and collection state.

Entry Points

maplebirch.tool.patch.addAntiques(key, config);
maplebirch.tool.patch.injectAntiques(_museumAntiqueText);

Use addAntiques to register data. Inject injectAntiques after vanilla creates _museumAntiqueText inside the museumAntiqueText widget.

Recommended injection point:

<<widget "museumAntiqueText">>
  <<if _museumAntiqueText is undefined>>
    <<set _museumAntiqueText to {
      ...
    }>>
    <<run maplebirch.tool.patch.injectAntiques(_museumAntiqueText)>>
  <</if>>
<</widget>>

The single injection call does both jobs:

  • Adds registered entries to _museumAntiqueText.
  • If $museumAntiques.antiques exists, adds missing keys as notFound and refreshes maxCount.

Minimal Example

maplebirch.tool.patch.addAntiques("antiquemyitem", {
  hint: '"For a curious little relic," Winter says.',
  museum: "The curious relic rests on a pedestal.",
  name: "Curious Relic",
  cn_name: "奇妙遗物",
  journal: '"A curious little relic."',
  journalName: "Small relic",
  icon: "antiques/my-relic.png",
});

Config Fields

FieldDescription
hintWinter hint text
museumDisplay text after the antique is in the museum
nameTrue name
cn_nameOptional Chinese display name
journalJournal description
journalNameOptional journal display name
iconIcon path
keyUnique id when using array config

State Flow

Antique state is still controlled by vanilla <<museumAntiqueStatus key status>>. Common states:

notFound -> found -> talk -> museum

stolen and recovered also exist. The framework only registers text and default state; discovery locations and rewards should remain in your own passages.

<<set $antiquemoney += 4000>>
<<museumAntiqueStatus "antiquemyitem" "found">>

boot.json

Object-map form. This is the recommended format when registering multiple entries.

{
  "framework": {
    "antiques": {
      "antiquemyitem": {
        "hint": "\"For a curious little relic,\" Winter says.",
        "museum": "The curious relic rests on a pedestal.",
        "name": "Curious Relic",
        "cn_name": "奇妙遗物",
        "journal": "\"A curious little relic.\"",
        "journalName": "Small relic",
        "icon": "antiques/my-relic.png"
      },
      "antiquemycoin": {
        "hint": "\"For a small old coin,\" Winter says.",
        "museum": "The old coin rests in a small display case.",
        "name": "Old Coin",
        "journal": "\"A small old coin.\"",
        "icon": "antiques/my-coin.png"
      }
    }
  }
}

External .json, .yaml, or .yml file:

{
  "framework": {
    "antiques": "data/antiques.yaml"
  }
}

Array form is also supported. Each item must include key:

- key: antiquemyitem
  hint: '"For a curious little relic," Winter says.'
  museum: The curious relic rests on a pedestal.
  name: Curious Relic
  cn_name: 奇妙遗物
  journal: '"A curious little relic."'
  journalName: Small relic
  icon: antiques/my-relic.png
- key: antiquemycoin
  hint: '"For a small old coin," Winter says.'
  museum: The old coin rests in a small display case.
  name: Old Coin
  journal: '"A small old coin."'
  icon: antiques/my-coin.png