mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-02-04 14:53:12 +08:00
Compare commits
5 Commits
39388c6eaf
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd5a003801 | ||
|
|
ddc87ebf40 | ||
|
|
23bcae0b74 | ||
|
|
e075dfc23d | ||
|
|
9088ab0eb1 |
Binary file not shown.
Binary file not shown.
@@ -12,8 +12,8 @@
|
||||
"test": "vitest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"v-transform": "^2.1.1",
|
||||
"vite": "^6.3.6",
|
||||
"vitest": "^3.1.1"
|
||||
"v-transform": "^2.2.0",
|
||||
"vite": "^7.3.1",
|
||||
"vitest": "^4.0.18"
|
||||
}
|
||||
}
|
||||
|
||||
973
pnpm-lock.yaml
generated
973
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user