Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
2b62a3a
remove unused libs from public
VickScarlet Jul 27, 2026
988fcac
update: event
VickScarlet Jul 27, 2026
50411b8
add: channel switch
VickScarlet Jul 27, 2026
6fdbcea
add: bili-toy-sdk cloud save support
VickScarlet Jul 27, 2026
43751ad
update: 名人模式解锁条件
VickScarlet Jul 27, 2026
42d8745
change: document.body theme color
VickScarlet Jul 27, 2026
1540a5d
fix: number check
VickScarlet Jul 28, 2026
4043fa8
update: ts
VickScarlet Jul 29, 2026
97988a9
update: data transformers
VickScarlet Jul 29, 2026
329a4e3
update: state, event, condition, data.event.types
VickScarlet Jul 30, 2026
72bf21d
update: state FlatMapper
VickScarlet Jul 30, 2026
f60e279
update: state FlatState
VickScarlet Jul 30, 2026
b4177d7
update: talent, state props
VickScarlet Aug 2, 2026
9df9e87
add: achievement, game
VickScarlet Aug 2, 2026
487a728
fix: trigger return id error
VickScarlet Aug 2, 2026
d30b93e
update: dependencies
VickScarlet Aug 3, 2026
727fe5d
update: core support rng
VickScarlet Aug 3, 2026
5353edd
update: hooks, web
VickScarlet Aug 10, 2026
88536c7
fix: talent
VickScarlet Aug 11, 2026
5d50a4e
feature: spirit allocation
VickScarlet Aug 11, 2026
cd339c2
update: game core flow pages
VickScarlet Aug 11, 2026
5a48214
feature: multiple lock, pick min max
VickScarlet Aug 12, 2026
f439141
feature: lock only one use radio mode
VickScarlet Aug 12, 2026
2d35eda
update: play property animation
VickScarlet Aug 12, 2026
5031f54
update: dev params
VickScarlet Aug 12, 2026
71daeb3
update: theme-toggle-btn position
VickScarlet Aug 12, 2026
4be851a
update: phone style
VickScarlet Aug 13, 2026
9c8478c
add: mode & character page
VickScarlet Aug 13, 2026
d0f7dbb
add: character
VickScarlet Aug 13, 2026
b8d2509
update: lint config
VickScarlet Aug 14, 2026
10debc6
update: character
VickScarlet Aug 14, 2026
a2e4023
update: character allocation
VickScarlet Aug 15, 2026
f2e8fac
update: achievement
VickScarlet Aug 15, 2026
ef55eb7
update: style
VickScarlet Aug 15, 2026
847d72c
update: thanks
VickScarlet Aug 15, 2026
63cc529
update: style
VickScarlet Aug 15, 2026
bc2d89f
update: style
VickScarlet Aug 15, 2026
0e8bf11
update: rename component
VickScarlet Aug 15, 2026
aff50e2
add: github button
VickScarlet Aug 15, 2026
9017780
add: toast achievement & message
VickScarlet Aug 16, 2026
30b4791
update: toast achievement icon & style
VickScarlet Aug 16, 2026
6c803d4
update: bili-toy
VickScarlet Aug 16, 2026
fca4b7b
update: remove debugger
VickScarlet Aug 16, 2026
da997b7
update: remove debug log
VickScarlet Aug 16, 2026
2c61552
feature: bili-toy cloud fallback local
VickScarlet Aug 16, 2026
91daaf7
fix: pickWeight now supports float weights via automatic scaling
VickScarlet Aug 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .dockerignore

This file was deleted.

30 changes: 19 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,32 @@ permissions:
contents: write
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
- name: 🛎️ Checkout
uses: actions/checkout@v4

- name: Install pnpm
- name: 🛠️ Install Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: 🛠️ Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
version: latest

- name: 📦 Install Dependencies
run: pnpm install

- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
pnpm install
pnpm xlsx2json
pnpm build
- name: 🏗️ Build data
run: bun build:data

- name: 🏗️ Build web
run: bun build:web

- name: Deploy 🚀
- name: 🚀 Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: template # The folder the action should deploy.
folder: apps/web/dist # The folder the action should deploy.
6 changes: 6 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Editor Browser",
"request": "launch",
"type": "editor-browser",
"url": "http://localhost:5173",
},
{
"type": "node",
"request": "launch",
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"js/ts.experimental.useTsgo": true
}
15 changes: 0 additions & 15 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 神戸小鳥
Copyright (c) 2021-2026 神戸小鳥 and 神户小德

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
51 changes: 7 additions & 44 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,19 @@
# Life Restart
# 人生重开模拟器

<a href="https://discord.gg/U3qrf49NMQ"><img src="https://img.shields.io/discord/883382868427014255?color=%23FEE75C&label=Discord&logo=discord&logoColor=white&style=for-the-badge" /></a>

[English](./README.md) | 简体中文

## 简介
## 开发环境

- Game Life Restart
包管理: `pnpm`
运行时: `bun`

## 使用

<details>
<summary><strong>网页版</strong></summary>
<br />
### 开发

```bash
# 1. 下载项目代码
git clone https://github.com/VickScarlet/lifeRestart.git my-project

# 2. 进入目录安装依赖
cd my-project
pnpm install

# 3. 转换XLSX表
pnpm xlsx2json

# 4. 启动本地开发服务器
pnpm build:data
pnpm dev
```

启动完成后打开浏览器访问 [http://localhost:5173](http://localhost:5173)。

</details>

<details>
<summary><strong>控制台版本</strong></summary>
<br />

```bash
node repl
```

</details>

## 其他版本

<details>
<summary><strong>版本列表</strong></summary>
<br />

- Cocos版:[gameall3d/LifeRestart_Cocos](https://github.com/gameall3d/LifeRestart_Cocos)

</details>

> 更多信息请参考 [官网文档](https://liferestart.syaro.io/)。
```
51 changes: 7 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,19 @@
# Life Restart
# Remake

<a href="https://discord.gg/U3qrf49NMQ"><img src="https://img.shields.io/discord/883382868427014255?color=%23FEE75C&label=Discord&logo=discord&logoColor=white&style=for-the-badge" /></a>

English | [简体中文](./README-zh_CN.md)

## Introduction
## Environment

- Game Life Restart
Package Manager: `pnpm`
Runtime: `bun`

## Usage

<details>
<summary><strong>Web Version</strong></summary>
<br />

### Dev

```bash
# 1. Clone project code.
git clone git@github.com:VickScarlet/lifeRestart.git my-project
cd my-project

# 2. Installation dependence.
pnpm install

# 3. Transform XLSX
pnpm xlsx2json

# 4. Start local dev server.
pnpm build:data
pnpm dev
```

After the startup is complete, open a browser and visit [http://localhost:5173](http://localhost:5173).
</details>

<details>
<summary><strong>Command Line Version</strong></summary>
<br />

```bash
node repl
```

</details>

## Other Version

<details>
<summary><strong>Versions</strong></summary>
<br />

- Cocos Ver: [gameall3d/LifeRestart_Cocos](https://github.com/gameall3d/LifeRestart_Cocos)

</details>

> More instructions at [documentation](https://liferestart.syaro.io/).
```
47 changes: 25 additions & 22 deletions repl/app.js → apps/console/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { dirname } from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
import { readFile } from 'fs/promises'
import Life from '../src/modules/life.js'
import $lang from '../src/i18n/zh-cn.js'
import Life from '../srco/modules/life.js'
import $lang from '../srco/i18n/zh-cn.js'
globalThis.$lang = $lang

globalThis.json = async fileName =>
Expand Down Expand Up @@ -235,7 +235,7 @@ class App {
this.#talentExtend = localStorage.talentExtend
await this.#life.initial(
dataSet => json(`${this.#language}/${dataSet}`),
json
json,
)
this.output(
`\rLoading Complete.
Expand All @@ -244,14 +244,14 @@ class App {

键入 \x1B[4m/remake\x1B[24m 开始游戏
键入 \x1B[4m/help\x1B[24m 获取帮助`,
true
true,
)
$$on('achievement', ({ name }) =>
this.output(`
-------------------------
解锁成就【${name}】
-------------------------
`)
`),
)
}

Expand Down Expand Up @@ -561,19 +561,19 @@ class App {
if (this.#talentSelected.has(s)) continue
if (this.#talentSelected.size == 3)
return warn(
'你只能选3个天赋。请使用 \x1B[4m/unselect\x1B[24m 取消选择你不想要的天赋'
'你只能选3个天赋。请使用 \x1B[4m/unselect\x1B[24m 取消选择你不想要的天赋',
)

const exclusive = this.#life.exclude(
Array.from(this.#talentSelected).map(({ id }) => id),
s.id
s.id,
)

if (exclusive != null)
for (const { name, id } of this.#talentSelected)
if (id == exclusive)
return warn(
`天赋【${s.name}】与已选择的天赋【${name}】冲突`
`天赋【${s.name}】与已选择的天赋【${name}】冲突`,
)

this.#talentSelected.add(s)
Expand Down Expand Up @@ -628,8 +628,8 @@ class App {
`grade${talent.grade}b`,
`${check(talent) ? '√' : ' '} ${i} ${talent.name}(${
talent.description
})`
)
})`,
),
),
]
.flat()
Expand All @@ -645,7 +645,7 @@ class App {
return warn(this.list(), `请选择 3 个天赋`)
this.#step = this.Steps.PROPERTY
this.#life.remake(
Array.from(this.#talentSelected).map(({ id }) => id)
Array.from(this.#talentSelected).map(({ id }) => id),
)
this.#propertyAllocation.total = this.#life.getPropertyPoints()
return this.prop()
Expand Down Expand Up @@ -673,15 +673,18 @@ class App {
this.#interval = null
this.#auto = false
} else if (this.#auto) {
this.#interval = setInterval(() => {
const trajectory = this.next()
if (this.#isEnd && this.#interval) {
clearInterval(this.#interval)
this.#interval = null
}
if (!this.#isEnd) return this.output(`${trajectory}\n`)
return this.output(trajectory, true)
}, Number(this.#auto) || 1000)
this.#interval = setInterval(
() => {
const trajectory = this.next()
if (this.#isEnd && this.#interval) {
clearInterval(this.#interval)
this.#interval = null
}
if (!this.#isEnd) return this.output(`${trajectory}\n`)
return this.output(trajectory, true)
},
Number(this.#auto) || 1000,
)
return
}
}
Expand Down Expand Up @@ -835,7 +838,7 @@ class App {
return this.prop()
case this.Steps.SUMMARY:
this.#talentExtend = Array.from(this.#talentSelected).sort(
() => Math.random() - 0.5
() => Math.random() - 0.5,
)[0].id
return this.list()
}
Expand All @@ -847,7 +850,7 @@ class App {
const { judge, grade, value } = summaryData[type]
return this.style(
`grade${grade}b`,
`${name}:${value} ${$lang[judge]}`
`${name}:${value} ${$lang[judge]}`,
)
}

Expand Down
File renamed without changes.
15 changes: 15 additions & 0 deletions apps/console/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@remake/console",
"type": "module",
"version": "3.0.0",
"author": "Vick Scarlet <vick@syaro.io>",
"scripts": {
"start": "bun run src/index.ts",
"lint": "bunx --bun eslint .",
"test": "bun test"
},
"dependencies": {
"@remake/core": "workspace:*",
"@remake/data": "workspace:*"
}
}
4 changes: 4 additions & 0 deletions apps/console/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["**/*"]
}
15 changes: 15 additions & 0 deletions apps/web/eslint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineConfig } from 'eslint/config'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import defaultConfig from '../../eslint.config.ts'

export default defineConfig([
defaultConfig,
{ ignores: ['dist/**', 'node_modules/**'] },
{
...react.configs.flat.recommended!,
settings: { react: { version: '19' } },
},
react.configs.flat['jsx-runtime']!,
reactHooks.configs.flat.recommended,
])
Loading
Loading