188 lines
4.6 KiB
TypeScript
188 lines
4.6 KiB
TypeScript
|
|
/**
|
|||
|
|
* design-card-game Prompt
|
|||
|
|
*
|
|||
|
|
* 引导用户设计新的卡牌游戏系统,定义卡牌模板和字段结构
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
export interface DesignCardGameOptions {
|
|||
|
|
/**
|
|||
|
|
* 卡牌组名称
|
|||
|
|
*/
|
|||
|
|
deck_name?: string;
|
|||
|
|
/**
|
|||
|
|
* 输出目录
|
|||
|
|
*/
|
|||
|
|
output_dir?: string;
|
|||
|
|
/**
|
|||
|
|
* 游戏类型/主题
|
|||
|
|
*/
|
|||
|
|
game_theme?: string;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export interface DesignCardGameResult {
|
|||
|
|
messages: PromptMessage[];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export interface PromptMessage {
|
|||
|
|
role: 'user' | 'assistant';
|
|||
|
|
content: TextContent | ImageContent | AudioContent | ResourceContent;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export interface TextContent {
|
|||
|
|
type: 'text';
|
|||
|
|
text: string;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export interface ImageContent {
|
|||
|
|
type: 'image';
|
|||
|
|
data: string;
|
|||
|
|
mimeType: string;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export interface AudioContent {
|
|||
|
|
type: 'audio';
|
|||
|
|
data: string;
|
|||
|
|
mimeType: string;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export interface ResourceContent {
|
|||
|
|
type: 'resource';
|
|||
|
|
resource: {
|
|||
|
|
uri: string;
|
|||
|
|
mimeType: string;
|
|||
|
|
text?: string;
|
|||
|
|
blob?: string;
|
|||
|
|
};
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 生成 design-card-game prompt 的消息
|
|||
|
|
*/
|
|||
|
|
export function designCardGame(options?: DesignCardGameOptions): DesignCardGameResult {
|
|||
|
|
const deckName = options?.deck_name || '未命名卡牌组';
|
|||
|
|
const outputDir = options?.output_dir || './content';
|
|||
|
|
const gameTheme = options?.game_theme || '通用';
|
|||
|
|
|
|||
|
|
const messages: PromptMessage[] = [
|
|||
|
|
{
|
|||
|
|
role: 'user',
|
|||
|
|
content: {
|
|||
|
|
type: 'text',
|
|||
|
|
text: `我想设计一个"${gameTheme}"主题的卡牌游戏,卡牌组名称为"${deckName}",输出目录为"${outputDir}"。请帮我设计卡牌的字段结构。`
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
role: 'assistant',
|
|||
|
|
content: {
|
|||
|
|
type: 'text',
|
|||
|
|
text: `好的!我来帮你设计"${deckName}"卡牌组的字段结构。
|
|||
|
|
|
|||
|
|
首先,让我了解一些基本信息:
|
|||
|
|
|
|||
|
|
## 1. 卡牌类型
|
|||
|
|
|
|||
|
|
这个卡牌游戏主要包含什么类型的卡牌?(可多选)
|
|||
|
|
- [ ] 角色卡(Characters)- 代表游戏中的人物或生物
|
|||
|
|
- [ ] 物品卡(Items)- 装备、道具、消耗品等
|
|||
|
|
- [ ] 法术/技能卡(Spells/Abilities)- 魔法、技能、动作等
|
|||
|
|
- [ ] 地点卡(Locations)- 场景、区域、地图等
|
|||
|
|
- [ ] 事件卡(Events)- 随机事件、剧情触发等
|
|||
|
|
- [ ] 其他:_______
|
|||
|
|
|
|||
|
|
## 2. 核心机制
|
|||
|
|
|
|||
|
|
卡牌游戏的核心机制是什么?
|
|||
|
|
- 是否有费用/资源系统?(如:法力值、行动点等)
|
|||
|
|
- 是否有稀有度系统?(如:普通、稀有、史诗、传说)
|
|||
|
|
- 是否有阵营/派系系统?
|
|||
|
|
- 是否有等级/强度系统?
|
|||
|
|
|
|||
|
|
## 3. 卡牌信息
|
|||
|
|
|
|||
|
|
每张卡牌通常需要展示哪些信息?
|
|||
|
|
- 卡牌名称(必填)
|
|||
|
|
- 卡牌描述/效果(必填)
|
|||
|
|
- 插画/图片(可选)
|
|||
|
|
- 其他属性:_______
|
|||
|
|
|
|||
|
|
请告诉我你的选择,我会为你生成合适的字段结构。
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
**示例参考:**
|
|||
|
|
|
|||
|
|
如果你想要快速开始,可以参考以下常见配置:
|
|||
|
|
|
|||
|
|
### 魔法物品卡牌组
|
|||
|
|
\`\`\`json
|
|||
|
|
{
|
|||
|
|
"fields": [
|
|||
|
|
{"name": "name", "description": "物品名称"},
|
|||
|
|
{"name": "type", "description": "物品类型", "examples": ["武器", "防具", "饰品", "消耗品"]},
|
|||
|
|
{"name": "rarity", "description": "稀有度", "examples": ["普通", "稀有", "史诗", "传说"]},
|
|||
|
|
{"name": "cost", "description": "价格/费用"},
|
|||
|
|
{"name": "effect", "description": "效果描述"}
|
|||
|
|
]
|
|||
|
|
}
|
|||
|
|
\`\`\`
|
|||
|
|
|
|||
|
|
### NPC 角色卡牌组
|
|||
|
|
\`\`\`json
|
|||
|
|
{
|
|||
|
|
"fields": [
|
|||
|
|
{"name": "name", "description": "角色名称"},
|
|||
|
|
{"name": "class", "description": "职业", "examples": ["战士", "法师", "盗贼", "牧师"]},
|
|||
|
|
{"name": "level", "description": "等级"},
|
|||
|
|
{"name": "background", "description": "背景故事"},
|
|||
|
|
{"name": "ability", "description": "特殊能力"}
|
|||
|
|
]
|
|||
|
|
}
|
|||
|
|
\`\`\`
|
|||
|
|
|
|||
|
|
### 塔罗牌组
|
|||
|
|
\`\`\`json
|
|||
|
|
{
|
|||
|
|
"fields": [
|
|||
|
|
{"name": "name", "description": "牌名"},
|
|||
|
|
{"name": "number", "description": "编号"},
|
|||
|
|
{"name": "element", "description": "元素", "examples": ["火", "水", "风", "土"]},
|
|||
|
|
{"name": "meaning", "description": "含义"},
|
|||
|
|
{"name": "reversed", "description": "逆位含义"}
|
|||
|
|
]
|
|||
|
|
}
|
|||
|
|
\`\`\``
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
];
|
|||
|
|
|
|||
|
|
return { messages };
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 获取 prompt 的元数据
|
|||
|
|
*/
|
|||
|
|
export function getDesignCardGamePrompt() {
|
|||
|
|
return {
|
|||
|
|
name: 'design-card-game',
|
|||
|
|
title: '设计卡牌游戏',
|
|||
|
|
description: '引导用户设计新的卡牌游戏系统,定义卡牌模板和字段结构',
|
|||
|
|
arguments: [
|
|||
|
|
{
|
|||
|
|
name: 'deck_name',
|
|||
|
|
description: '卡牌组名称',
|
|||
|
|
required: false
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
name: 'output_dir',
|
|||
|
|
description: '输出目录(相对路径)',
|
|||
|
|
required: false
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
name: 'game_theme',
|
|||
|
|
description: '游戏主题/类型(如:奇幻、科幻、恐怖等)',
|
|||
|
|
required: false
|
|||
|
|
}
|
|||
|
|
]
|
|||
|
|
};
|
|||
|
|
}
|