mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-02-04 14:53:12 +08:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd5a003801 | ||
|
|
ddc87ebf40 | ||
|
|
23bcae0b74 | ||
|
|
e075dfc23d | ||
|
|
9088ab0eb1 | ||
|
|
39388c6eaf | ||
|
|
0ce9b0ed02 | ||
|
|
aee4fcf164 | ||
|
|
5c0fe56915 | ||
|
|
b82da6c9a7 | ||
|
|
b1ffae9eaf | ||
|
|
fee986432d | ||
|
|
25fc74398a |
11
.github/dependabot.yml
vendored
Normal file
11
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "" # See documentation for possible values
|
||||
directory: "/" # Location of package manifests
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
@@ -14,38 +14,22 @@
|
||||
<summary><strong>网页版</strong></summary>
|
||||
<br />
|
||||
|
||||
1. 下载项目代码。
|
||||
|
||||
```bash
|
||||
# 1. 下载项目代码
|
||||
git clone https://github.com/VickScarlet/lifeRestart.git my-project
|
||||
|
||||
# 2. 进入目录安装依赖
|
||||
cd my-project
|
||||
```
|
||||
|
||||
2. 进入目录安装依赖。
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
```
|
||||
|
||||
或者
|
||||
# 3. 转换XLSX表
|
||||
pnpm xlsx2json
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
3. 启动本地服务器。
|
||||
|
||||
```bash
|
||||
# 4. 启动本地开发服务器
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
或者
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
4. 启动完成后会自动打开浏览器访问 [http://localhost:5173](http://localhost:5173)。
|
||||
启动完成后打开浏览器访问 [http://localhost:5173](http://localhost:5173)。
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
27
README.md
27
README.md
@@ -14,38 +14,23 @@ English | [简体中文](./README-zh_CN.md)
|
||||
<summary><strong>Web Version</strong></summary>
|
||||
<br />
|
||||
|
||||
1. Clone project code.
|
||||
|
||||
```bash
|
||||
# 1. Clone project code.
|
||||
git clone git@github.com:VickScarlet/lifeRestart.git my-project
|
||||
cd my-project
|
||||
```
|
||||
|
||||
2. Installation dependence.
|
||||
|
||||
```bash
|
||||
# 2. Installation dependence.
|
||||
pnpm install
|
||||
```
|
||||
|
||||
Or
|
||||
# 3. Transform XLSX
|
||||
pnpm xlsx2json
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
3. Start local server.
|
||||
|
||||
```bash
|
||||
# 4. Start local dev server.
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
Or
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
4. After the startup is complete, open a browser and visit [http://localhost:5173](http://localhost:5173).
|
||||
After the startup is complete, open a browser and visit [http://localhost:5173](http://localhost:5173).
|
||||
</details>
|
||||
|
||||
<details>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
50
index.html
50
index.html
@@ -17,55 +17,19 @@
|
||||
<meta http-equiv="Cache-Control" content="no-siteapp"/>
|
||||
<font-face font-family="方正像素12" src="fonts/方正像素12.ttf"/>
|
||||
<title>Life Restart</title>
|
||||
<!--以下引用了常用类库,如果不使用,可以删除-->
|
||||
|
||||
<!--核心包,封装了显示对象渲染,事件,时间管理,时间轴动画,缓动,消息交互,socket,本地存储,鼠标触摸,声音,加载,颜色滤镜,位图字体等-->
|
||||
<!--
|
||||
<script type="text/javascript" src="libs/laya/laya.core.js"></script>
|
||||
<!--提供了微信小游戏的适配-->
|
||||
<!-- <script type="text/javascript" src="libs/laya/laya.wxmini.js"></script> -->
|
||||
<!--提供了百度小游戏的适配-->
|
||||
<!-- <script type="text/javascript" src="libs/laya/laya.bdmini.js"></script> -->
|
||||
<!--提供了小米小游戏的适配-->
|
||||
<!-- <script type="text/javascript" src="libs/laya/laya.xmmini.js"></script> -->
|
||||
<!--提供了OPPO小游戏的适配-->
|
||||
<!-- <script type="text/javascript" src="libs/laya/laya.quickgamemini.js"></script> -->
|
||||
<!--提供了bilibili小游戏的适配-->
|
||||
<!-- <script type="text/javascript" src="libs/laya/laya.bilimini.js"></script> -->
|
||||
<!--提供了Alipay小游戏的适配-->
|
||||
<!-- <script type="text/javascript" src="libs/laya/laya.Alipaymini.js"></script> -->
|
||||
<!--提供了qq小游戏的适配-->
|
||||
<!-- <script type="text/javascript" src="libs/laya/laya.qqmini.js"></script> -->
|
||||
<!--提供了字节跳动小游戏的适配-->
|
||||
<!-- <script type="text/javascript" src="libs/laya/laya.ttmini.js"></script> -->
|
||||
<!--提供了华为快游戏的适配-->
|
||||
<!-- <script type="text/javascript" src="libs/laya/laya.hwmini.js"></script> -->
|
||||
<!--提供了淘宝商家应用的适配-->
|
||||
<!-- <script type="text/javascript" src="libs/laya/laya.tbmini.js"></script> -->
|
||||
<!--提供了淘宝小部件的适配-->
|
||||
<!-- <script type="text/javascript" src="libs/laya/laya.tbplugin.js"></script> -->
|
||||
<!--封装了webgl渲染管线,如果使用webgl渲染,可以在初始化时调用Laya.init(1000,800,laya.webgl.WebGL);-->
|
||||
<script type="text/javascript" src="libs/laya/laya.webgl.js"></script>
|
||||
<!--提供了VIVO小游戏的适配-->
|
||||
<!-- <script type="text/javascript" src="libs/laya/laya.vvmini.js"></script> -->
|
||||
<!--是动画模块,包含了swf动画,骨骼动画等-->
|
||||
<!-- <script type="text/javascript" src="libs/laya/laya.ani.js"></script> -->
|
||||
<!--包含更多webgl滤镜,比如外发光,阴影,模糊以及更多-->
|
||||
<script type="text/javascript" src="libs/laya/laya.filter.js"></script>
|
||||
<!--封装了html动态排版功能-->
|
||||
<script type="text/javascript" src="libs/laya/laya.html.js"></script>
|
||||
<!--粒子类库-->
|
||||
<script type="text/javascript" src="libs/laya/laya.particle.js"></script>
|
||||
<!--提供tileMap解析支持-->
|
||||
<!-- <script type="text/javascript" src="libs/laya/laya.tiledmap.js"></script> -->
|
||||
<!--提供了制作UI的各种组件实现-->
|
||||
<script type="text/javascript" src="libs/laya/laya.ui.js"></script>
|
||||
<!-- 提供LayaAir3d接口 -->
|
||||
<!-- <script type="text/javascript" src="libs/laya/laya.d3.js"></script> -->
|
||||
|
||||
<!-- 物理引擎matter.js -->
|
||||
<!--自定义的js(src文件夹下)文件自动添加到下面jsfile模块标签里面里,js的顺序可以手动修改,修改后保留修改的顺序,新增加的js会默认依次追加到标签里-->
|
||||
<!--删除标签,ide不会自动添加js文件,请谨慎操作-->
|
||||
|
||||
-->
|
||||
<script type="text/javascript" src="libs/laya/min/laya.core.min.js"></script>
|
||||
<script type="text/javascript" src="libs/laya/min/laya.webgl.min.js"></script>
|
||||
<script type="text/javascript" src="libs/laya/min/laya.filter.min.js"></script>
|
||||
<script type="text/javascript" src="libs/laya/min/laya.particle.min.js"></script>
|
||||
<script type="text/javascript" src="libs/laya/min/laya.ui.min.js"></script>
|
||||
<script type="module" src="src/index.js"></script>
|
||||
</head>
|
||||
<body style="background:black"></body>
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
{
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=759670
|
||||
// for the documentation about the jsconfig.json format
|
||||
"compilerOptions": {
|
||||
"target": "es5"
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"public",
|
||||
"view"
|
||||
]
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=759670
|
||||
// for the documentation about the jsconfig.json format
|
||||
"compilerOptions": {
|
||||
"module": "esnext",
|
||||
"target": "es6",
|
||||
},
|
||||
"include":["src", "repl", "vite.config.js"],
|
||||
"exclude": ["node_modules", "public", "view"]
|
||||
}
|
||||
@@ -12,8 +12,8 @@
|
||||
"test": "vitest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"v-transform": "^2.1.1",
|
||||
"vite": "^6.2.5",
|
||||
"vitest": "^3.1.1"
|
||||
"v-transform": "^2.2.0",
|
||||
"vite": "^7.3.1",
|
||||
"vitest": "^4.0.18"
|
||||
}
|
||||
}
|
||||
|
||||
1098
pnpm-lock.yaml
generated
1098
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -174,7 +174,7 @@ class Life {
|
||||
type: this.PropertyTypes.TLT,
|
||||
name,
|
||||
grade,
|
||||
description,
|
||||
description: this.format(description),
|
||||
})
|
||||
if(!effect) continue;
|
||||
this.#property.effect(effect);
|
||||
@@ -188,8 +188,8 @@ class Life {
|
||||
this.#property.effect(effect);
|
||||
const content = {
|
||||
type: this.PropertyTypes.EVT,
|
||||
description,
|
||||
postEvent,
|
||||
description: this.format(description),
|
||||
postEvent: postEvent && this.format(postEvent),
|
||||
grade,
|
||||
}
|
||||
if(next) return [content, this.doEvent(next)].flat();
|
||||
@@ -245,6 +245,23 @@ class Life {
|
||||
return util.getListValuesMap(types.flat(), key => this.#property.get(key));
|
||||
}
|
||||
|
||||
format(discription) {
|
||||
return discription.replaceAll(/\{\s*[0-9a-zA-Z_-]+\s*?\}/g, (match) => this.#format(match));
|
||||
}
|
||||
|
||||
#format(key) {
|
||||
switch (key.slice(1, -1).trim().toLowerCase()) {
|
||||
case 'currentyear': return new Date().getFullYear()
|
||||
case 'age': return this.#property.get(this.PropertyTypes.AGE)
|
||||
case 'charm': return this.#property.get(this.PropertyTypes.CHR)
|
||||
case 'intelligence': return this.#property.get(this.PropertyTypes.INT)
|
||||
case 'strength': return this.#property.get(this.PropertyTypes.STR)
|
||||
case 'money': return this.#property.get(this.PropertyTypes.MNY)
|
||||
case 'spirit': return this.#property.get(this.PropertyTypes.SPR)
|
||||
default: return key
|
||||
}
|
||||
}
|
||||
|
||||
get lastExtendTalent() {
|
||||
return this.#property.get(this.PropertyTypes.EXT);
|
||||
}
|
||||
|
||||
@@ -68,10 +68,17 @@ class Talent {
|
||||
|
||||
exclude(talents, excludeId) {
|
||||
const { exclude } = this.get(excludeId);
|
||||
if(!exclude) return null;
|
||||
for(const talent of talents) {
|
||||
for(const e of exclude) {
|
||||
if(talent == e) return talent;
|
||||
if(exclude) {
|
||||
for(const e of exclude) {
|
||||
if(talent == e) return talent;
|
||||
}
|
||||
}
|
||||
const excludeReverse = this.get(talent).exclude;
|
||||
if(excludeReverse) {
|
||||
for (const e of excludeReverse) {
|
||||
if (excludeId == e) return talent
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user