feat: SodiumPet 小钠桌宠 v0.1.0(Live2D 桌宠 / 经济任务 / 音乐 / 成就 / 编辑器 / MOD)

This commit is contained in:
Tian_XiaRi
2026-12-01 16:41:07 +08:00
commit d25e726ef7
261 changed files with 33676 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
const root = 'C:/Users/ASUS/Documents/deepseek-harness/default-workspace/desktop-pet/'
const fs = require('fs')
const os = require('os')
const path = require('path')
const { StateStore } = require(root + 'out/main/stateStore.js')
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'pet-'))
const store = new StateStore(dir)
store.snapshot()
// 直接改内部 save 测试(同进程可直接访问)
store['save'].stats.satiety = 10
store['save'].money = 100
const r = store.autoBuy('riceball')
console.log('autoBuy:', r.ok, r.message, '| money', store['save'].money, '| satiety', store['save'].stats.satiety, '| inv', store['save'].inventory['riceball'])
const f1 = store.forgiveAccident()
const f2 = store.forgiveAccident()
console.log('forgive:', f1, f2)
;(async () => {
try {
const r = await fetch('https://cn.bing.com/search?q=test', {
signal: AbortSignal.timeout(8000),
headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)' }
})
console.log('bing status:', r.status)
} catch (e) {
console.log('bing FAIL:', e.message)
}
})()