Skip to main content
Glama
bellsanct
by bellsanct

view_status

Display character status, equipment, and current activities in the MCP Dungeon Game to monitor progress and manage gameplay.

Instructions

キャラクターの状態、ステータス、装備、現在の活動を表示します。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
save_keyYesセーブキー

Implementation Reference

  • The 'viewStatus' function retrieves player data from storage, calculates total equipment stats, and formats a string displaying the player's status, equipment, and current dungeon progress.
    export async function viewStatus(saveKey: string): Promise<string> {
      const data = await storage.load(saveKey);
      
      if (!data.player.name) {
        return "プレイヤーが見つかりません。先に'create_player'を実行してください。";
      }
    
      const stats = calculateTotalStats(data.player.equipment);
      
      // 状態アイコン
      const stateIcon = data.player.state === 'exploring' ? '⚔️' : '🏠';
      const stateText = data.player.state === 'exploring' ? '探索中' : '待機中';
      
      let output = `=== ${data.player.name} ===\n\n`;
      output += `状態: ${stateIcon} ${stateText}\n`;
      output += `HP: ${data.player.hp}/${data.player.maxHp}\n`;
      output += `ゴールド: ${data.player.gold}\n\n`;
    
      output += `ステータス:\n`;
      output += `  攻撃力: ${stats.attack}\n`;
      output += `  防御力: ${stats.defense}\n`;
      output += `  速度: ${stats.speed}\n`;
      output += `  運: ${stats.luck}%\n\n`;
      
      output += `装備:\n`;
      const slotNames: { [key: string]: string } = {
        weapon: '武器',
        shield: '盾',
        armor: '防具',
        accessory: 'アクセサリ',
        item1: '持ち物1',
        item2: '持ち物2'
      };
    
      for (const [slot, item] of Object.entries(data.player.equipment)) {
        if (slot === 'length') continue; // インデックスシグネチャ対応
        const slotName = slotNames[slot] || slot;
    
        if (slot === 'item1' || slot === 'item2') {
          // 持ち物スロット
          if (item && 'effect' in item) {
            const holdingItem = item as Item;
            output += `  ${slotName}: ${holdingItem.name}\n`;
            output += `    効果: ${holdingItem.description}\n`;
          } else {
            output += `  ${slotName}: (なし)\n`;
          }
        } else {
          // 装備スロット
          if (item && 'stats' in item) {
            const equipment = item as Equipment;
            output += `  ${slotName}: ${equipment.name} [${equipment.rarity}]\n`;
            output += `    ステータス: 攻撃+${equipment.stats.attack} 防御+${equipment.stats.defense} 速度+${equipment.stats.speed} 運+${equipment.stats.luck}\n`;
          } else {
            output += `  ${slotName}: (なし)\n`;
          }
        }
      }
    
      output += `\n装備インベントリ: ${data.player.inventory.length}個\n`;
      output += `持ち物インベントリ: ${data.player.itemInventory?.length || 0}個\n`;
    
      if (data.player.currentDungeon) {
        const now = Date.now();
        const { startTime, estimatedEndTime } = data.player.currentDungeon;
        const remaining = Math.max(0, estimatedEndTime - now);
        const totalTime = estimatedEndTime - startTime;
        const elapsed = now - startTime;
        const progressPercentage = Math.min((elapsed / totalTime) * 100, 100);
    
        const minutes = Math.ceil(remaining / 60000);
        const seconds = Math.ceil((remaining % 60000) / 1000);
    
        output += `\n⚔️  ダンジョン探索中!\n`;
        output += `進行状況: ${progressPercentage.toFixed(1)}%\n`;
        output += `残り時間: ${minutes}分${seconds}秒\n`;
    
        // 簡易プログレスバー
        const barLength = 15;
        const filledLength = Math.floor((progressPercentage / 100) * barLength);
        const bar = '█'.repeat(filledLength) + '░'.repeat(barLength - filledLength);
        output += `[${bar}]\n`;
    
        output += `\n'check_progress'で詳細な進行状況を確認できます。`;
      }
    
      return output;
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bellsanct/mcp-dungeon-game'

If you have feedback or need assistance with the MCP directory API, please join our Discord server