check_progress
Check current dungeon exploration progress and process results when complete using a save key.
Instructions
現在のダンジョン探索の進行状況を確認します。完了している場合は結果を処理します。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| save_key | Yes | セーブキー |
Implementation Reference
- src/tools/dungeon.ts:124-250 (handler)The 'check_progress' tool handler function that calculates and returns the current status, estimated floors, and progress of a player currently exploring a dungeon.
export async function checkProgress(saveKey: string): Promise<string> { const data = await storage.load(saveKey); if (!data.player.name) { return "プレイヤーが見つかりません。先に'create_player'を実行してください。"; } if (!data.player.currentDungeon) { return "現在探索中のダンジョンはありません。\n\n'list_dungeons'で利用可能なダンジョンを確認できます。"; } const now = Date.now(); const { dungeonId, startTime, estimatedEndTime } = data.player.currentDungeon; const remaining = estimatedEndTime - now; if (remaining > 0) { // 探索中 - リアルタイム進行状況を計算 const dungeon = getDungeonById(dungeonId); if (!dungeon) { return "エラー: ダンジョンデータが見つかりません。"; } // 経過時間と進行度を計算 const totalTime = estimatedEndTime - startTime; const elapsed = now - startTime; const progressPercentage = Math.min((elapsed / totalTime) * 100, 100); // 現在の階層を推定(線形補間) const currentFloor = Math.floor((dungeon.floors * progressPercentage) / 100); const displayFloor = Math.max(1, Math.min(currentFloor, dungeon.floors)); // 残り時間表示 const minutes = Math.ceil(remaining / 60000); const seconds = Math.ceil((remaining % 60000) / 1000); let output = `⚔️ ${dungeon.name}を探索中...\n\n`; output += `進行状況: ${progressPercentage.toFixed(1)}%\n`; output += `推定現在地: ${displayFloor}階 / ${dungeon.floors}階\n`; output += `残り時間: ${minutes}分${seconds}秒\n\n`; // プログレスバー const barLength = 20; const filledLength = Math.floor((progressPercentage / 100) * barLength); const bar = '█'.repeat(filledLength) + '░'.repeat(barLength - filledLength); output += `[${bar}] ${progressPercentage.toFixed(0)}%\n\n`; // 装備している持ち物の状態 const playerStats = calculateTotalStats(data.player.equipment); const equippedHerb = data.player.equipment.item1?.type === 'herb' ? data.player.equipment.item1 : data.player.equipment.item2?.type === 'herb' ? data.player.equipment.item2 : undefined; const equippedCharm = data.player.equipment.item1?.type === 'charm' ? data.player.equipment.item1 : data.player.equipment.item2?.type === 'charm' ? data.player.equipment.item2 : undefined; if (equippedHerb || equippedCharm) { output += `持ち物状態:\n`; if (equippedHerb) { output += ` 🌿 ${equippedHerb.name}: 待機中\n`; } if (equippedCharm) { output += ` 🛡️ ${equippedCharm.name}: 待機中\n`; } output += '\n'; } // 探索中の活動概要(推定) output += `=== 探索状況 ===\n`; // 進行度に基づいて推定される活動 const estimatedBattles = Math.floor(displayFloor * 2); // 各階2戦想定 const estimatedEvents = Math.floor(displayFloor * 0.3); // 30%程度でイベント output += `推定戦闘数: 約${estimatedBattles}回\n`; output += `推定イベント: 約${estimatedEvents}回\n\n`; // 現在までの階層表示と推定バトルログ if (displayFloor > 1) { output += `通過した階層:\n`; const maxDisplay = Math.min(displayFloor, 5); // 最新5階まで表示 const startFloor = Math.max(1, displayFloor - maxDisplay + 1); for (let f = startFloor; f <= displayFloor; f++) { if (f === displayFloor) { output += ` → ${f}階 (探索中...)\n`; } else { output += ` ✓ ${f}階 (通過済み)\n`; } } if (displayFloor < dungeon.floors) { output += ` ... ${dungeon.floors - displayFloor}階が残っています\n`; } output += '\n'; // 推定バトルログ(最新3階分) output += `最近の戦闘(推定):\n`; const recentFloors = Math.min(3, displayFloor); const logStartFloor = Math.max(1, displayFloor - recentFloors + 1); for (let f = logStartFloor; f <= displayFloor; f++) { // ランダムに敵を選択(実際はシミュレーション) const enemy1 = dungeon.enemies[Math.floor(Math.random() * dungeon.enemies.length)]; const enemy2 = dungeon.enemies[Math.floor(Math.random() * dungeon.enemies.length)]; if (f === displayFloor) { output += ` ${f}階: ${enemy1.name}と交戦中...\n`; } else { output += ` ${f}階: ${enemy1.name}, ${enemy2.name}を撃破\n`; } } output += '\n'; } output += `💡 ヒント:\n`; output += `- 'view_status'でキャラクター情報を確認\n`; output += `- 完了後、もう一度'check_progress'で詳細な結果を確認\n`; output += `- 'view_battle_log'で完了後の戦闘ログを閲覧可能\n`; return output; }