cc_recall
Recall a retired creature to your party. Only works in Millhaven. Specify the creature's nickname or species name.
Instructions
Invite a retired creature back into your party. Only available in Millhaven.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nickname | Yes | The nickname (or species name) of the creature to recall. |
Implementation Reference
- src/games/crittercatch/index.ts:476-516 (registration)Registration of the 'cc_recall' tool via server.tool() — defines its name, description, input schema (nickname string), and registers the handler function.
// ── Recall ─────────────────────────────────────────────────────────────── server.tool( 'cc_recall', 'Invite a retired creature back into your party. Only available in Millhaven.', { nickname: z.string().describe("The nickname (or species name) of the creature to recall.") }, async ({ nickname }) => { const s = requireGame(); const turnBlock = checkTurn(s); if (turnBlock) return turnBlock; if (s.currentArea !== 'millhaven') { return err('You can only recall companions from Millhaven. Head home first.'); } const idx = s.retired.findIndex(m => m.nickname.toLowerCase() === nickname.toLowerCase()); if (idx === -1) { const names = s.retired.map(m => m.nickname).join(', ') || 'none'; return err(`No creature named "${nickname}" is resting at home.\n\nAt home: ${names}`); } if (s.party.length >= MAX_PARTY) { return err(`Your party is full (${MAX_PARTY}/${MAX_PARTY}). Release or retire someone first.`); } const member = s.retired.splice(idx, 1)[0]; const species = SPECIES[member.speciesId]; s.party.push(member); addToLog(s, `${member.nickname} rejoined the party.`); const lines = [ `${member.nickname} is at the gate before you've reached it.`, '', `${species.bondQuotes.high}.`, '', 'They fall into step beside you.', '', renderParty(s), ]; return ok(lines.join('\n')); }, ); - src/games/crittercatch/index.ts:482-516 (handler)Handler function for 'cc_recall': validates player is in Millhaven, finds the retired creature by nickname, checks party isn't full, then splices the creature from retired[] into party[] and returns flavor text.
async ({ nickname }) => { const s = requireGame(); const turnBlock = checkTurn(s); if (turnBlock) return turnBlock; if (s.currentArea !== 'millhaven') { return err('You can only recall companions from Millhaven. Head home first.'); } const idx = s.retired.findIndex(m => m.nickname.toLowerCase() === nickname.toLowerCase()); if (idx === -1) { const names = s.retired.map(m => m.nickname).join(', ') || 'none'; return err(`No creature named "${nickname}" is resting at home.\n\nAt home: ${names}`); } if (s.party.length >= MAX_PARTY) { return err(`Your party is full (${MAX_PARTY}/${MAX_PARTY}). Release or retire someone first.`); } const member = s.retired.splice(idx, 1)[0]; const species = SPECIES[member.speciesId]; s.party.push(member); addToLog(s, `${member.nickname} rejoined the party.`); const lines = [ `${member.nickname} is at the gate before you've reached it.`, '', `${species.bondQuotes.high}.`, '', 'They fall into step beside you.', '', renderParty(s), ]; return ok(lines.join('\n')); }, ); - Input schema for cc_recall — requires a single 'nickname' string parameter (the name of the creature to recall).
{ nickname: z.string().describe("The nickname (or species name) of the creature to recall.") }, - The 'retired: PartyMember[]' field on PlayerState — the data store that cc_recall reads from and splices from.
retired: PartyMember[]; - ownsSpecies helper — checks both party and retired arrays, used by cc_recall indirectly for game win conditions.
export function ownsSpecies(state: PlayerState, speciesId: string): boolean { return state.party.some(m => m.speciesId === speciesId) || state.retired.some(m => m.speciesId === speciesId); }