feat: SodiumPet 小钠桌宠 v0.1.0(Live2D 桌宠 / 经济任务 / 音乐 / 成就 / 编辑器 / MOD)
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
const fs = require('fs')
|
||||
const base = 'C:/Users/ASUS/Documents/deepseek-harness/default-workspace/desktop-pet/src/'
|
||||
function patch(file, pairs) {
|
||||
const p = base + file
|
||||
let c = fs.readFileSync(p, 'utf8')
|
||||
for (const [from, to] of pairs) {
|
||||
if (!c.includes(from)) {
|
||||
console.log('MISS in', file, '::', from.slice(0, 70).replace(/\n/g, '\\n'))
|
||||
continue
|
||||
}
|
||||
c = c.replace(from, to)
|
||||
}
|
||||
fs.writeFileSync(p, c, 'utf8')
|
||||
}
|
||||
|
||||
// 6) 普通风格的建议话题
|
||||
patch('shared/dialogue.ts', [
|
||||
[
|
||||
`/** 对话框里的预设问题,按状态轮换 */
|
||||
export function suggestions(save: PetSave): string[] {
|
||||
const s = save.stats
|
||||
const pool: string[] = []
|
||||
if (s.satiety < 40) pool.push('你饿不饿?')
|
||||
if (s.paraffin < 40) pool.push('石蜡油还够吗?')
|
||||
if (s.oxidation > 50) pool.push('最近是不是该抛光了?')
|
||||
if (s.electron < 40) pool.push('要不要睡一会儿?')
|
||||
if (s.mood < 50) pool.push('今天怎么了?')
|
||||
pool.push(
|
||||
'今天在做什么?',
|
||||
'讲个化学小知识吧',
|
||||
'你喜欢小氯吗?',
|
||||
'被夸会脸红吗?',
|
||||
'你是怎么被画出来的?',
|
||||
'实验室里最讨厌什么?',
|
||||
'想吃点什么?',
|
||||
'带我看看你的记录本'
|
||||
)
|
||||
return pool.slice(0, 6)
|
||||
}`,
|
||||
`/** 对话框里的预设问题,按状态与文本风格轮换 */
|
||||
export function suggestions(save: PetSave, flavor = 'chemistry'): string[] {
|
||||
const s = save.stats
|
||||
const pool: string[] = []
|
||||
const chemistry = flavor !== 'normal'
|
||||
if (s.satiety < 40) pool.push('你饿不饿?')
|
||||
if (chemistry) {
|
||||
if (s.paraffin < 40) pool.push('石蜡油还够吗?')
|
||||
if (s.oxidation > 50) pool.push('最近是不是该抛光了?')
|
||||
} else {
|
||||
if (s.paraffin < 40) pool.push('要不要喝点水?')
|
||||
if (s.oxidation > 50) pool.push('是不是该洗个澡了?')
|
||||
}
|
||||
if (s.electron < 40) pool.push('要不要睡一会儿?')
|
||||
if (s.mood < 50) pool.push('今天怎么了?')
|
||||
if (chemistry) {
|
||||
pool.push(
|
||||
'今天在做什么?',
|
||||
'讲个化学小知识吧',
|
||||
'你喜欢小氯吗?',
|
||||
'被夸会脸红吗?',
|
||||
'你是怎么被画出来的?',
|
||||
'实验室里最讨厌什么?',
|
||||
'想吃点什么?',
|
||||
'带我看看你的记录本'
|
||||
)
|
||||
} else {
|
||||
pool.push(
|
||||
'今天在做什么?',
|
||||
'给我讲个笑话吧',
|
||||
'你最喜欢什么?',
|
||||
'被夸会脸红吗?',
|
||||
'你平时喜欢做什么?',
|
||||
'最讨厌什么?',
|
||||
'想吃点什么?',
|
||||
'今天心情怎么样?'
|
||||
)
|
||||
}
|
||||
return pool.slice(0, 6)
|
||||
}`
|
||||
]
|
||||
])
|
||||
|
||||
// ChatBar 传 flavor
|
||||
patch('renderer/src/chat/ChatBar.tsx', [
|
||||
[
|
||||
" const list = state ? suggestions(state) : flavor === 'normal' ? PRESETS_NORMAL : PRESETS_CHEM",
|
||||
" const list = state\n ? suggestions(state, flavor)\n : flavor === 'normal'\n ? PRESETS_NORMAL\n : PRESETS_CHEM"
|
||||
]
|
||||
])
|
||||
|
||||
console.log('flavor suggestions patched')
|
||||
Reference in New Issue
Block a user