5 Commits

Author SHA1 Message Date
Vick Scarlet
dd5a003801 update: dependencies 2026-01-26 18:21:44 +08:00
Vick Scarlet
ddc87ebf40 update: dependencies 2026-01-26 17:50:24 +08:00
dependabot[bot]
23bcae0b74 Bump js-yaml in the npm_and_yarn group across 1 directory
Bumps the npm_and_yarn group with 1 update in the / directory: [js-yaml](https://github.com/nodeca/js-yaml).


Updates `js-yaml` from 4.1.0 to 4.1.1
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.1.0...4.1.1)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.1.1
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-26 15:14:19 +08:00
dependabot[bot]
e075dfc23d Bump vite in the npm_and_yarn group across 1 directory
Bumps the npm_and_yarn group with 1 update in the / directory: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite).


Updates `vite` from 6.3.6 to 6.4.1
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/create-vite@6.4.1/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.4.1
  dependency-type: direct:development
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-26 15:09:16 +08:00
Vick Scarlet
9088ab0eb1 add: support template prop 2026-01-26 14:47:35 +08:00
5 changed files with 444 additions and 558 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -12,8 +12,8 @@
"test": "vitest" "test": "vitest"
}, },
"devDependencies": { "devDependencies": {
"v-transform": "^2.1.1", "v-transform": "^2.2.0",
"vite": "^6.3.6", "vite": "^7.3.1",
"vitest": "^3.1.1" "vitest": "^4.0.18"
} }
} }

973
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -174,7 +174,7 @@ class Life {
type: this.PropertyTypes.TLT, type: this.PropertyTypes.TLT,
name, name,
grade, grade,
description, description: this.format(description),
}) })
if(!effect) continue; if(!effect) continue;
this.#property.effect(effect); this.#property.effect(effect);
@@ -188,8 +188,8 @@ class Life {
this.#property.effect(effect); this.#property.effect(effect);
const content = { const content = {
type: this.PropertyTypes.EVT, type: this.PropertyTypes.EVT,
description, description: this.format(description),
postEvent, postEvent: postEvent && this.format(postEvent),
grade, grade,
} }
if(next) return [content, this.doEvent(next)].flat(); if(next) return [content, this.doEvent(next)].flat();
@@ -245,6 +245,23 @@ class Life {
return util.getListValuesMap(types.flat(), key => this.#property.get(key)); 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() { get lastExtendTalent() {
return this.#property.get(this.PropertyTypes.EXT); return this.#property.get(this.PropertyTypes.EXT);
} }