JSON 資料結構(卡片庫)
你可以直接修改下方 <script type="application/json" id="cardData">
的內容來增刪卡片或章節;下方為欄位說明:
// JSON 檔案(無註解);以下為「」說明(範例在檔尾 cardData 中)
{
"chapters": ["forest","city"], // 章節代碼(任意字串;在下拉選單中使用)
"types": { // 類別代碼 => 顯示名稱(UI 可用)
"monster": "怪物", "mana": "魔法力", "heal": "治療", "item": "道具", "event": "事件"
},
"cards": [
{
"id": "wolf", // 卡片唯一 ID(用於圖鑑與狀態記錄)
"type": "monster", // 取值:monster|mana|heal|item|event
"chapter": "forest", // "forest" | "city" | "both"(會在相符章節中出現)
"name": "森林惡狼", // 顯示名稱
"icon": "🐺", // Emoji 或圖示字元
"desc": "撕咬過路者。", // 敘事描述(非必填)
"stats": { "hp": 6, "atk": 2 }, // 怪物專用數值(其他類型可省略)
"effect": { // 非怪物的效果欄:依類型使用
"mp": 2, // mana:增加 MP 數量
"hp": 4, // heal:回復 HP(受治療加成)
"itemKey": "atk1", // item:可定義 atk1/def1/herb/shield3…
"eventKey": "pool" // event:pool|atk1|def1|chest…
}
}
]
}
新增卡片:加入一筆 cards[]
,指定 type
與對應欄位即可;新增章節:在 chapters[]
加入代碼並在 UI 下拉選單同步。