ot_hunt
Spend half a day and use ammo to hunt for food with unpredictable results. Narrate the hunt to the human.
Instructions
Stop to hunt for food. Takes half a day, uses ammo, and the results are unpredictable. Narrate the hunt to the human.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/games/oregontrail.ts:880-918 (handler)The actual handler/implementation of the 'ot_hunt' tool. It stops to hunt for food: consumes 10 ammo, has random outcomes (15% nothing, 30% modest 3-6 food, 35% solid 8-14 food, 20% exceptional 16-24 food).
server.tool( "ot_hunt", "Stop to hunt for food. Takes half a day, uses ammo, and the results are unpredictable. Narrate the hunt to the human.", {}, async () => { if (!otGame) return { content: [{ type: "text", text: "No journey in progress." }], isError: true }; if (otGame.status === "won" || otGame.status === "game_over") return { content: [{ type: "text", text: "The journey is over." }], isError: true }; if (otGame.supplies.ammo <= 0) return { content: [{ type: "text", text: `No ammunition left. Nothing to hunt with.\n\n${renderState(otGame)}` }], isError: true }; otGame.supplies.ammo = Math.max(0, otGame.supplies.ammo - 10); const roll = Math.random(); let text: string; let foodGained = 0; if (roll < 0.15) { text = "Nothing. Half a day and ten rounds spent on shadows. The trail mocks you."; } else if (roll < 0.45) { foodGained = rand(3, 6); text = `A modest haul — enough to stretch provisions a few more days.`; } else if (roll < 0.80) { foodGained = rand(8, 14); text = `A solid hunt. You return to camp before dark with real food. ${otGame.companion.name} looks relieved.`; } else { foodGained = rand(16, 24); text = `An exceptional day. ${otGame.companion.name} looks genuinely impressed. You'll eat well tonight.`; } otGame.supplies.food += foodGained; log(otGame, `Hunting: ${text.slice(0, 60)}… (+${foodGained} days food)`); return { content: [{ type: "text", text: `${text}${foodGained > 0 ? ` (+${foodGained} days of provisions)` : ""}\n\n${renderState(otGame)}`, }], }; } ); - src/games/oregontrail.ts:880-882 (registration)The tool registration for 'ot_hunt' via server.tool(). The 2nd argument is the description string, and the 3rd argument is an empty schema object (no parameters).
server.tool( "ot_hunt", "Stop to hunt for food. Takes half a day, uses ammo, and the results are unpredictable. Narrate the hunt to the human.", - src/index.ts:7-7 (registration)Import of the Oregon Trail tools registration function.
import { registerOregonTrailTools } from "./games/oregontrail.js"; - src/index.ts:19-19 (registration)Call to register Oregon Trail tools on the MCP server, which registers ot_hunt.
registerOregonTrailTools(server);